In [1]:
import pandas as pd
import numpy as np
from sklearn.cluster import DBSCAN, AgglomerativeClustering, OPTICS
from sklearn.metrics.cluster import (homogeneity_score, silhouette_score, davies_bouldin_score,
                                     adjusted_rand_score, calinski_harabasz_score, adjusted_mutual_info_score,
                                     v_measure_score, completeness_score)

from sklearn.datasets import make_moons
from collections import defaultdict
import itertools

import matplotlib.pyplot as plt

import warnings
warnings.filterwarnings('ignore')
In [2]:
pd.set_option('display.max.rows', None)

Generate toy dataset

In [3]:
dataset = make_moons(n_samples=2000, noise=0.75)
In [4]:
data, labels = dataset

Baseline algorithms

In [5]:
clustering_algorithms = (DBSCAN, AgglomerativeClustering, OPTICS)
clustering_algorithms_titles = ('DBSCAN', 'AgglomerativeClustering', 'OPTICS')
clustering_metrics = (homogeneity_score, silhouette_score, davies_bouldin_score, adjusted_rand_score, 
                      calinski_harabasz_score, adjusted_mutual_info_score, v_measure_score, completeness_score)
clustering_metrics_titles = ('homogeneity_score', 'silhouette_score', 'davies_bouldin_score',
                             'adjusted_rand_index', 'calinski_harabasz_score', 'adjusted_mutual_info',
                             'v_measure_score', 'completeness_score'
                            )

Calculate metrics for each algorithm

In [6]:
labels_mapping = {}

metrics_dataframe = pd.DataFrame(index=clustering_algorithms_titles, columns=clustering_metrics_titles)

for clustering_algorithm, clustering_algorithms_title in zip(clustering_algorithms, clustering_algorithms_titles):
    algorithm = clustering_algorithm()
    tmp_predictions = algorithm.fit_predict(data)
    
    labels_mapping[clustering_algorithms_title] = tmp_predictions
    
    for metric, metric_title in zip(clustering_metrics, clustering_metrics_titles):
        if metric_title not in ('silhouette_score', 'davies_bouldin_score', 'calinski_harabasz_score'):
            metrics_dataframe.loc[clustering_algorithms_title, metric_title] = metric(labels, tmp_predictions)
        else:
            metrics_dataframe.loc[clustering_algorithms_title, metric_title] = metric(data, labels)
In [7]:
metrics_dataframe.index.name = 'clustering_algorithm'
metrics_dataframe
Out[7]:
homogeneity_score silhouette_score davies_bouldin_score adjusted_rand_index calinski_harabasz_score adjusted_mutual_info v_measure_score completeness_score
clustering_algorithm
DBSCAN 0 0.134101 1.97292 -7.97205e-06 408.465 -0.000752646 0 0
AgglomerativeClustering 0.115096 0.134101 1.97292 0.153244 408.465 0.11516 0.11548 0.115867
OPTICS 0.141913 0.134101 1.97292 0.00101 408.465 0.0378084 0.0549031 0.0340353
In [8]:
def highlight_min(data, color='yellow'):
    attr = 'background-color: {}'.format(color)
    data = data.replace('%','', regex=True).astype(float)
    if data.ndim == 1:
        bound = data == data.min() 
        return [attr if row else '' for row in bound]
    else:
        bound = data == data.min().min()  
        return pd.DataFrame(np.where(bound, attr, ''), index=data.index, columns=data.columns)
    
def highlight_max(data, color='yellow'):
    attr = 'background-color: {}'.format(color)
    data = data.replace('%','', regex=True).astype(float)
    if data.ndim == 1:
        bound = data == data.max() 
        return [attr if row else '' for row in bound]
    else:
        bound = data == data.max().max()  
        return pd.DataFrame(np.where(bound, attr, ''), index=data.index, columns=data.columns)
In [9]:
metrics_best_mapping = {'davies_bouldin_score': highlight_min,
                       'calinski_harabasz_score': highlight_max,
                       'silhouette_score': highlight_max,
                       'homogeneity_score': highlight_max,
                       'adjusted_rand_index': highlight_max,
                       'adjusted_mutual_info': highlight_max,
                       'v_measure_score': highlight_max,
                       'completeness_score': highlight_max
                       }

metrics_min = ['davies_bouldin_score']
metrics_max = list(set(clustering_metrics_titles) - set(metrics_min))

Find best algorithms for each metric of clusterization

Davies_bouldin_score we have to minimize

In [10]:
metrics_dataframe[metrics_min].style.apply(highlight_min)
Out[10]:
davies_bouldin_score
clustering_algorithm
DBSCAN 1.972918
AgglomerativeClustering 1.972918
OPTICS 1.972918

Other metrics we have to maximize

In [11]:
metrics_dataframe[metrics_max].style.apply(highlight_max)
Out[11]:
homogeneity_score v_measure_score completeness_score adjusted_mutual_info adjusted_rand_index calinski_harabasz_score silhouette_score
clustering_algorithm
DBSCAN 0.000000 0.000000 0.000000 -0.000753 -0.000008 408.464819 0.134101
AgglomerativeClustering 0.115096 0.115480 0.115867 0.115160 0.153244 408.464819 0.134101
OPTICS 0.141913 0.054903 0.034035 0.037808 0.001010 408.464819 0.134101

Agglomerative Clustering seems to be the best algorithm, according to clusterization metrics

Vizualize clusters for each method

In [12]:
fig, axs = plt.subplots(nrows=len(clustering_algorithms_titles), ncols=1, figsize=(10, 20))

idx = 0

for clustering_algorithm, labels in labels_mapping.items():
    colors_mapping = [(item/255.) for item in labels]
    axs[idx].scatter(data[:, 0], data[:, 1], c=colors_mapping);
    axs[idx].set_title('{}, number of selected clusters: {}'.format(clustering_algorithm, len(set(labels))))
    
    idx += 1

According to visualisation's results we can say that the best algorithm for clustering is Agglomerative Clustering.

Thus we consider that the best metrics for evaluate clustering are v_measure_score, completeness_score, adjusted_mutual_info and adjusted_rand_index.

Experiments with parameters

DBSCAN

Experiments with min samples, metric and epsilon

In [37]:
min_samples_range = range(2, 10)
distance_metrics = ('euclidean', 'l1', 'l2', 'manhattan', 'cosine', 'chebyshev')
epsilons_range = (1e-5, 1e-4, 1e-3, 0.01, 0.1)
In [38]:
dbscan_clustering_labels_mapping = {eps: {metrics: {samples: None for samples in min_samples_range} 
                                     for metrics in distance_metrics} 
                                    for eps in epsilons_range}


index = pd.MultiIndex.from_product((min_samples_range, distance_metrics, epsilons_range))

metrics_dataframe_dbscan = pd.DataFrame(index=index, columns=clustering_metrics_titles)
In [39]:
for min_samples, distance_metric, epsilon in itertools.product(min_samples_range, distance_metrics, epsilons_range):
    algorithm = DBSCAN(min_samples=min_samples, metric=distance_metric, eps=epsilon)
    dbscan_predictions = algorithm.fit_predict(data)
    
    dbscan_clustering_labels_mapping[epsilon][distance_metric][min_samples] = dbscan_predictions
    
    for metric, metric_title in zip(clustering_metrics, clustering_metrics_titles):
        if metric_title not in ('silhouette_score', 'davies_bouldin_score', 'calinski_harabasz_score'):
            metrics_dataframe_dbscan.loc[(min_samples, distance_metric, epsilon), metric_title] = metric(
                labels, dbscan_predictions)
        else:
            metrics_dataframe_dbscan.loc[(min_samples, distance_metric, epsilon), metric_title] = metric(data, labels)
In [40]:
metrics_dataframe_dbscan.index.names = ['min_samples', 'metrics', 'epsilon']
metrics_dataframe_dbscan
Out[40]:
homogeneity_score silhouette_score davies_bouldin_score adjusted_rand_index calinski_harabasz_score adjusted_mutual_info v_measure_score completeness_score
min_samples metrics epsilon
2 euclidean 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 0.00212968 -0.209239 1.65569 0.000188881 10.6631 0.000901936 0.00423619 0.389229
0.01000 0.0597561 -0.209239 1.65569 0.0281215 10.6631 0.0453195 0.106962 0.509305
0.10000 0.331754 -0.209239 1.65569 -0.061022 10.6631 0.200227 0.375183 0.431694
l1 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 0.00212968 -0.209239 1.65569 0.000188881 10.6631 0.000901936 0.00423619 0.389229
0.01000 0.0401821 -0.209239 1.65569 0.0205699 10.6631 0.0324298 0.074655 0.525432
0.10000 0.578801 -0.209239 1.65569 0.0384051 10.6631 0.329033 0.518904 0.470241
l2 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 0.00212968 -0.209239 1.65569 0.000188881 10.6631 0.000901936 0.00423619 0.389229
0.01000 0.0597561 -0.209239 1.65569 0.0281215 10.6631 0.0453195 0.106962 0.509305
0.10000 0.331754 -0.209239 1.65569 -0.061022 10.6631 0.200227 0.375183 0.431694
manhattan 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 0.00212968 -0.209239 1.65569 0.000188881 10.6631 0.000901936 0.00423619 0.389229
0.01000 0.0401821 -0.209239 1.65569 0.0205699 10.6631 0.0324298 0.074655 0.525432
0.10000 0.578801 -0.209239 1.65569 0.0384051 10.6631 0.329033 0.518904 0.470241
cosine 0.00001 0.611106 -0.209239 1.65569 0.00310503 10.6631 0.11063 0.43854 0.341973
0.00010 0.289466 -0.209239 1.65569 -0.0400928 10.6631 0.19225 0.329548 0.382513
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
chebyshev 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 0.00212968 -0.209239 1.65569 0.000188881 10.6631 0.000901936 0.00423619 0.389229
0.01000 0.0685236 -0.209239 1.65569 0.0332633 10.6631 0.0526444 0.120935 0.514338
0.10000 0.188671 -0.209239 1.65569 -0.0984233 10.6631 0.100187 0.250294 0.371696
3 euclidean 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.309783 -0.209239 1.65569 -0.0438736 10.6631 0.227516 0.370036 0.459385
l1 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.535455 -0.209239 1.65569 0.0924593 10.6631 0.37282 0.522862 0.510849
l2 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.309783 -0.209239 1.65569 -0.0438736 10.6631 0.227516 0.370036 0.459385
manhattan 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.535455 -0.209239 1.65569 0.0924593 10.6631 0.37282 0.522862 0.510849
cosine 0.00001 0.545079 -0.209239 1.65569 0.00724173 10.6631 0.11938 0.417109 0.337802
0.00010 0.288982 -0.209239 1.65569 -0.0400973 10.6631 0.192117 0.329132 0.382238
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
chebyshev 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 0.00285043 -0.209239 1.65569 0.000254821 10.6631 0.00118594 0.00565682 0.366101
0.10000 0.177531 -0.209239 1.65569 -0.0884698 10.6631 0.12751 0.246054 0.400721
4 euclidean 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.351188 -0.209239 1.65569 0.0374633 10.6631 0.324129 0.430417 0.55581
l1 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.510729 -0.209239 1.65569 0.209859 10.6631 0.438721 0.549228 0.594005
l2 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.351188 -0.209239 1.65569 0.0374633 10.6631 0.324129 0.430417 0.55581
manhattan 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.510729 -0.209239 1.65569 0.209859 10.6631 0.438721 0.549228 0.594005
cosine 0.00001 0.478999 -0.209239 1.65569 0.0194364 10.6631 0.120729 0.395245 0.336421
0.00010 0.306394 -0.209239 1.65569 -0.0433273 10.6631 0.203502 0.340899 0.384161
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
chebyshev 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.205542 -0.209239 1.65569 -0.0569046 10.6631 0.190202 0.285743 0.468578
5 euclidean 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.357622 -0.209239 1.65569 0.0858907 10.6631 0.355875 0.448583 0.601598
l1 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.505316 -0.209239 1.65569 0.25479 10.6631 0.44343 0.550532 0.604636
l2 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.357622 -0.209239 1.65569 0.0858907 10.6631 0.355875 0.448583 0.601598
manhattan 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.505316 -0.209239 1.65569 0.25479 10.6631 0.44343 0.550532 0.604636
cosine 0.00001 0.418196 -0.209239 1.65569 0.0585298 10.6631 0.13328 0.379441 0.347259
0.00010 0.303195 -0.209239 1.65569 -0.0432437 10.6631 0.202574 0.338433 0.382939
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
chebyshev 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.244589 -0.209239 1.65569 -0.0197397 10.6631 0.250736 0.336414 0.538628
6 euclidean 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.357512 -0.209239 1.65569 0.131179 10.6631 0.368412 0.453451 0.619766
l1 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.419073 -0.209239 1.65569 0.210664 10.6631 0.39217 0.496935 0.610332
l2 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.357512 -0.209239 1.65569 0.131179 10.6631 0.368412 0.453451 0.619766
manhattan 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.419073 -0.209239 1.65569 0.210664 10.6631 0.39217 0.496935 0.610332
cosine 0.00001 0.317186 -0.209239 1.65569 0.057531 10.6631 0.109752 0.327983 0.339542
0.00010 0.312632 -0.209239 1.65569 -0.039032 10.6631 0.211111 0.345744 0.386701
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
chebyshev 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.273424 -0.209239 1.65569 0.0273987 10.6631 0.287674 0.368801 0.566364
7 euclidean 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.302881 -0.209239 1.65569 0.136618 10.6631 0.337327 0.407557 0.622796
l1 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.339161 -0.209239 1.65569 0.156088 10.6631 0.319387 0.430648 0.589723
l2 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.302881 -0.209239 1.65569 0.136618 10.6631 0.337327 0.407557 0.622796
manhattan 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.339161 -0.209239 1.65569 0.156088 10.6631 0.319387 0.430648 0.589723
cosine 0.00001 0.224995 -0.209239 1.65569 0.0681203 10.6631 0.100778 0.273502 0.348671
0.00010 0.31269 -0.209239 1.65569 -0.0401478 10.6631 0.199504 0.342124 0.377674
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
chebyshev 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.245809 -0.209239 1.65569 0.046511 10.6631 0.271405 0.341076 0.556918
8 euclidean 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.364015 -0.209239 1.65569 0.157489 10.6631 0.359414 0.446923 0.578735
l1 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.23904 -0.209239 1.65569 0.105102 10.6631 0.23783 0.338547 0.57998
l2 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.364015 -0.209239 1.65569 0.157489 10.6631 0.359414 0.446923 0.578735
manhattan 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.23904 -0.209239 1.65569 0.105102 10.6631 0.23783 0.338547 0.57998
cosine 0.00001 0.147984 -0.209239 1.65569 0.0464943 10.6631 0.076558 0.207688 0.348151
0.00010 0.315485 -0.209239 1.65569 -0.0388738 10.6631 0.201754 0.344345 0.379018
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
chebyshev 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.256338 -0.209239 1.65569 0.0809764 10.6631 0.284938 0.352519 0.56422
9 euclidean 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.287244 -0.209239 1.65569 0.0946173 10.6631 0.286173 0.37246 0.529564
l1 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.167686 -0.209239 1.65569 0.0826433 10.6631 0.18165 0.263297 0.612579
l2 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.287244 -0.209239 1.65569 0.0946173 10.6631 0.286173 0.37246 0.529564
manhattan 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.167686 -0.209239 1.65569 0.0826433 10.6631 0.18165 0.263297 0.612579
cosine 0.00001 0.106951 -0.209239 1.65569 0.0426508 10.6631 0.0584434 0.163737 0.349084
0.00010 0.294291 -0.209239 1.65569 -0.0350197 10.6631 0.200848 0.331786 0.380232
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
chebyshev 0.00001 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00010 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.00100 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.01000 -8.40311e-18 -0.209239 1.65569 0 10.6631 -7.8269e-17 -1.68062e-17 1
0.10000 0.30465 -0.209239 1.65569 0.112639 10.6631 0.312983 0.389916 0.541462

Find best parameters for DBSCAN Clustering

Davies_bouldin_score we have to minimize

In [41]:
metrics_dataframe_dbscan[metrics_min].style.apply(highlight_min)
Out[41]:
davies_bouldin_score
min_samples metrics epsilon
2 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
3 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
4 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
5 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
6 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
7 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
8 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
9 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692

Other metrics we have to maximize

In [42]:
metrics_dataframe_dbscan[metrics_max].style.apply(highlight_max)
Out[42]:
homogeneity_score v_measure_score completeness_score adjusted_mutual_info adjusted_rand_index calinski_harabasz_score silhouette_score
min_samples metrics epsilon
2 euclidean 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 0.002130 0.004236 0.389229 0.000902 0.000189 10.663137 -0.209239
0.01 0.059756 0.106962 0.509305 0.045320 0.028122 10.663137 -0.209239
0.1 0.331754 0.375183 0.431694 0.200227 -0.061022 10.663137 -0.209239
l1 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 0.002130 0.004236 0.389229 0.000902 0.000189 10.663137 -0.209239
0.01 0.040182 0.074655 0.525432 0.032430 0.020570 10.663137 -0.209239
0.1 0.578801 0.518904 0.470241 0.329033 0.038405 10.663137 -0.209239
l2 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 0.002130 0.004236 0.389229 0.000902 0.000189 10.663137 -0.209239
0.01 0.059756 0.106962 0.509305 0.045320 0.028122 10.663137 -0.209239
0.1 0.331754 0.375183 0.431694 0.200227 -0.061022 10.663137 -0.209239
manhattan 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 0.002130 0.004236 0.389229 0.000902 0.000189 10.663137 -0.209239
0.01 0.040182 0.074655 0.525432 0.032430 0.020570 10.663137 -0.209239
0.1 0.578801 0.518904 0.470241 0.329033 0.038405 10.663137 -0.209239
cosine 1e-05 0.611106 0.438540 0.341973 0.110630 0.003105 10.663137 -0.209239
0.0001 0.289466 0.329548 0.382513 0.192250 -0.040093 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
chebyshev 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 0.002130 0.004236 0.389229 0.000902 0.000189 10.663137 -0.209239
0.01 0.068524 0.120935 0.514338 0.052644 0.033263 10.663137 -0.209239
0.1 0.188671 0.250294 0.371696 0.100187 -0.098423 10.663137 -0.209239
3 euclidean 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.309783 0.370036 0.459385 0.227516 -0.043874 10.663137 -0.209239
l1 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.535455 0.522862 0.510849 0.372820 0.092459 10.663137 -0.209239
l2 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.309783 0.370036 0.459385 0.227516 -0.043874 10.663137 -0.209239
manhattan 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.535455 0.522862 0.510849 0.372820 0.092459 10.663137 -0.209239
cosine 1e-05 0.545079 0.417109 0.337802 0.119380 0.007242 10.663137 -0.209239
0.0001 0.288982 0.329132 0.382238 0.192117 -0.040097 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
chebyshev 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 0.002850 0.005657 0.366101 0.001186 0.000255 10.663137 -0.209239
0.1 0.177531 0.246054 0.400721 0.127510 -0.088470 10.663137 -0.209239
4 euclidean 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.351188 0.430417 0.555810 0.324129 0.037463 10.663137 -0.209239
l1 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.510729 0.549228 0.594005 0.438721 0.209859 10.663137 -0.209239
l2 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.351188 0.430417 0.555810 0.324129 0.037463 10.663137 -0.209239
manhattan 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.510729 0.549228 0.594005 0.438721 0.209859 10.663137 -0.209239
cosine 1e-05 0.478999 0.395245 0.336421 0.120729 0.019436 10.663137 -0.209239
0.0001 0.306394 0.340899 0.384161 0.203502 -0.043327 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
chebyshev 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.205542 0.285743 0.468578 0.190202 -0.056905 10.663137 -0.209239
5 euclidean 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.357622 0.448583 0.601598 0.355875 0.085891 10.663137 -0.209239
l1 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.505316 0.550532 0.604636 0.443430 0.254790 10.663137 -0.209239
l2 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.357622 0.448583 0.601598 0.355875 0.085891 10.663137 -0.209239
manhattan 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.505316 0.550532 0.604636 0.443430 0.254790 10.663137 -0.209239
cosine 1e-05 0.418196 0.379441 0.347259 0.133280 0.058530 10.663137 -0.209239
0.0001 0.303195 0.338433 0.382939 0.202574 -0.043244 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
chebyshev 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.244589 0.336414 0.538628 0.250736 -0.019740 10.663137 -0.209239
6 euclidean 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.357512 0.453451 0.619766 0.368412 0.131179 10.663137 -0.209239
l1 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.419073 0.496935 0.610332 0.392170 0.210664 10.663137 -0.209239
l2 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.357512 0.453451 0.619766 0.368412 0.131179 10.663137 -0.209239
manhattan 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.419073 0.496935 0.610332 0.392170 0.210664 10.663137 -0.209239
cosine 1e-05 0.317186 0.327983 0.339542 0.109752 0.057531 10.663137 -0.209239
0.0001 0.312632 0.345744 0.386701 0.211111 -0.039032 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
chebyshev 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.273424 0.368801 0.566364 0.287674 0.027399 10.663137 -0.209239
7 euclidean 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.302881 0.407557 0.622796 0.337327 0.136618 10.663137 -0.209239
l1 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.339161 0.430648 0.589723 0.319387 0.156088 10.663137 -0.209239
l2 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.302881 0.407557 0.622796 0.337327 0.136618 10.663137 -0.209239
manhattan 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.339161 0.430648 0.589723 0.319387 0.156088 10.663137 -0.209239
cosine 1e-05 0.224995 0.273502 0.348671 0.100778 0.068120 10.663137 -0.209239
0.0001 0.312690 0.342124 0.377674 0.199504 -0.040148 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
chebyshev 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.245809 0.341076 0.556918 0.271405 0.046511 10.663137 -0.209239
8 euclidean 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.364015 0.446923 0.578735 0.359414 0.157489 10.663137 -0.209239
l1 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.239040 0.338547 0.579980 0.237830 0.105102 10.663137 -0.209239
l2 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.364015 0.446923 0.578735 0.359414 0.157489 10.663137 -0.209239
manhattan 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.239040 0.338547 0.579980 0.237830 0.105102 10.663137 -0.209239
cosine 1e-05 0.147984 0.207688 0.348151 0.076558 0.046494 10.663137 -0.209239
0.0001 0.315485 0.344345 0.379018 0.201754 -0.038874 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
chebyshev 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.256338 0.352519 0.564220 0.284938 0.080976 10.663137 -0.209239
9 euclidean 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.287244 0.372460 0.529564 0.286173 0.094617 10.663137 -0.209239
l1 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.167686 0.263297 0.612579 0.181650 0.082643 10.663137 -0.209239
l2 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.287244 0.372460 0.529564 0.286173 0.094617 10.663137 -0.209239
manhattan 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.167686 0.263297 0.612579 0.181650 0.082643 10.663137 -0.209239
cosine 1e-05 0.106951 0.163737 0.349084 0.058443 0.042651 10.663137 -0.209239
0.0001 0.294291 0.331786 0.380232 0.200848 -0.035020 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
chebyshev 1e-05 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.0001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.001 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.01 -0.000000 -0.000000 1.000000 -0.000000 0.000000 10.663137 -0.209239
0.1 0.304650 0.389916 0.541462 0.312983 0.112639 10.663137 -0.209239

Seems like epsilon 0.1 with 4 clusters and L1 or 5 clusters and manhattan metrics are the best for DBSCAN algorithm

OPTICS

Experiments with min samples, metric and epsilon

In [43]:
min_samples_range = range(2, 10)
distance_metrics = ('euclidean', 'l1', 'l2', 'manhattan', 'cosine', 'chebyshev')

epsilons_range = (1e-5, 1e-4, 1e-3, 0.01, 0.1)
In [44]:
optics_clustering_labels_mapping = {eps: {metrics: {samples: None for samples in min_samples_range} 
                                     for metrics in distance_metrics} 
                                    for eps in epsilons_range}

index = pd.MultiIndex.from_product((min_samples_range, distance_metrics, epsilons_range))

metrics_dataframe_optics = pd.DataFrame(index=index, columns=clustering_metrics_titles)
In [45]:
for min_samples, distance_metric, epsilon in itertools.product(min_samples_range, distance_metrics, epsilons_range):
    algorithm = OPTICS(min_samples=min_samples, metric=distance_metric, eps=epsilon)
    optics_predictions = algorithm.fit_predict(data)
    
    optics_clustering_labels_mapping[epsilon][distance_metric][min_samples] = optics_predictions
    
    for metric, metric_title in zip(clustering_metrics, clustering_metrics_titles):
        if metric_title not in ('silhouette_score', 'davies_bouldin_score', 'calinski_harabasz_score'):
            metrics_dataframe_optics.loc[(min_samples, distance_metric, epsilon), metric_title] = metric(
                labels, optics_predictions)
        else:
            metrics_dataframe_optics.loc[(min_samples, distance_metric, epsilon), metric_title] = metric(data, labels)
In [46]:
metrics_dataframe_optics.index.names = ['min_samples', 'metrics', 'epsilon']
metrics_dataframe_optics
Out[46]:
homogeneity_score silhouette_score davies_bouldin_score adjusted_rand_index calinski_harabasz_score adjusted_mutual_info v_measure_score completeness_score
min_samples metrics epsilon
2 euclidean 0.00001 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
0.00010 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
0.00100 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
0.01000 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
0.10000 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
l1 0.00001 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
0.00010 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
0.00100 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
0.01000 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
0.10000 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
l2 0.00001 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
0.00010 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
0.00100 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
0.01000 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
0.10000 0.835575 -0.209239 1.65569 0.0185687 10.6631 0.238611 0.561198 0.422471
manhattan 0.00001 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
0.00010 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
0.00100 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
0.01000 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
0.10000 0.819782 -0.209239 1.65569 0.0243951 10.6631 0.242293 0.559087 0.424192
cosine 0.00001 0.727347 -0.209239 1.65569 -0.000168506 10.6631 0.0348715 0.462433 0.338973
0.00010 0.727347 -0.209239 1.65569 -0.000168506 10.6631 0.0348715 0.462433 0.338973
0.00100 0.727347 -0.209239 1.65569 -0.000168506 10.6631 0.0348715 0.462433 0.338973
0.01000 0.727347 -0.209239 1.65569 -0.000168506 10.6631 0.0348715 0.462433 0.338973
0.10000 0.727347 -0.209239 1.65569 -0.000168506 10.6631 0.0348715 0.462433 0.338973
chebyshev 0.00001 0.837425 -0.209239 1.65569 0.0238625 10.6631 0.244605 0.563881 0.425041
0.00010 0.837425 -0.209239 1.65569 0.0238625 10.6631 0.244605 0.563881 0.425041
0.00100 0.837425 -0.209239 1.65569 0.0238625 10.6631 0.244605 0.563881 0.425041
0.01000 0.837425 -0.209239 1.65569 0.0238625 10.6631 0.244605 0.563881 0.425041
0.10000 0.837425 -0.209239 1.65569 0.0238625 10.6631 0.244605 0.563881 0.425041
3 euclidean 0.00001 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
0.00010 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
0.00100 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
0.01000 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
0.10000 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
l1 0.00001 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
0.00010 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
0.00100 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
0.01000 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
0.10000 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
l2 0.00001 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
0.00010 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
0.00100 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
0.01000 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
0.10000 0.72365 -0.209239 1.65569 0.142826 10.6631 0.368579 0.587255 0.494122
manhattan 0.00001 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
0.00010 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
0.00100 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
0.01000 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
0.10000 0.749542 -0.209239 1.65569 0.159165 10.6631 0.390759 0.602697 0.503964
cosine 0.00001 0.601349 -0.209239 1.65569 -0.00259827 10.6631 0.0509625 0.4214 0.324343
0.00010 0.601349 -0.209239 1.65569 -0.00259827 10.6631 0.0509625 0.4214 0.324343
0.00100 0.601349 -0.209239 1.65569 -0.00259827 10.6631 0.0509625 0.4214 0.324343
0.01000 0.601349 -0.209239 1.65569 -0.00259827 10.6631 0.0509625 0.4214 0.324343
0.10000 0.601349 -0.209239 1.65569 -0.00259827 10.6631 0.0509625 0.4214 0.324343
chebyshev 0.00001 0.752441 -0.209239 1.65569 0.135375 10.6631 0.380402 0.597431 0.495379
0.00010 0.752441 -0.209239 1.65569 0.135375 10.6631 0.380402 0.597431 0.495379
0.00100 0.752441 -0.209239 1.65569 0.135375 10.6631 0.380402 0.597431 0.495379
0.01000 0.752441 -0.209239 1.65569 0.135375 10.6631 0.380402 0.597431 0.495379
0.10000 0.752441 -0.209239 1.65569 0.135375 10.6631 0.380402 0.597431 0.495379
4 euclidean 0.00001 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
0.00010 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
0.00100 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
0.01000 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
0.10000 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
l1 0.00001 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
0.00010 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
0.00100 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
0.01000 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
0.10000 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
l2 0.00001 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
0.00010 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
0.00100 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
0.01000 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
0.10000 0.705554 -0.209239 1.65569 0.347648 10.6631 0.51344 0.65694 0.614594
manhattan 0.00001 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
0.00010 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
0.00100 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
0.01000 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
0.10000 0.741969 -0.209239 1.65569 0.380037 10.6631 0.543465 0.678945 0.625789
cosine 0.00001 0.558866 -0.209239 1.65569 0.00732226 10.6631 0.085944 0.415329 0.330456
0.00010 0.558866 -0.209239 1.65569 0.00732226 10.6631 0.085944 0.415329 0.330456
0.00100 0.558866 -0.209239 1.65569 0.00732226 10.6631 0.085944 0.415329 0.330456
0.01000 0.558866 -0.209239 1.65569 0.00732226 10.6631 0.085944 0.415329 0.330456
0.10000 0.558866 -0.209239 1.65569 0.00732226 10.6631 0.085944 0.415329 0.330456
chebyshev 0.00001 0.747669 -0.209239 1.65569 0.365002 10.6631 0.53649 0.676667 0.61798
0.00010 0.747669 -0.209239 1.65569 0.365002 10.6631 0.53649 0.676667 0.61798
0.00100 0.747669 -0.209239 1.65569 0.365002 10.6631 0.53649 0.676667 0.61798
0.01000 0.747669 -0.209239 1.65569 0.365002 10.6631 0.53649 0.676667 0.61798
0.10000 0.747669 -0.209239 1.65569 0.365002 10.6631 0.53649 0.676667 0.61798
5 euclidean 0.00001 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
0.00010 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
0.00100 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
0.01000 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
0.10000 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
l1 0.00001 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
0.00010 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
0.00100 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
0.01000 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
0.10000 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
l2 0.00001 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
0.00010 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
0.00100 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
0.01000 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
0.10000 0.955963 -0.209239 1.65569 0.920004 10.6631 0.946037 0.960209 0.964493
manhattan 0.00001 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
0.00010 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
0.00100 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
0.01000 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
0.10000 0.751716 -0.209239 1.65569 0.536624 10.6631 0.653711 0.745028 0.738458
cosine 0.00001 0.510696 -0.209239 1.65569 -0.000356378 10.6631 0.085849 0.395365 0.322528
0.00010 0.510696 -0.209239 1.65569 -0.000356378 10.6631 0.085849 0.395365 0.322528
0.00100 0.510696 -0.209239 1.65569 -0.000356378 10.6631 0.085849 0.395365 0.322528
0.01000 0.510696 -0.209239 1.65569 -0.000356378 10.6631 0.085849 0.395365 0.322528
0.10000 0.510696 -0.209239 1.65569 -0.000356378 10.6631 0.085849 0.395365 0.322528
chebyshev 0.00001 0.726195 -0.209239 1.65569 0.524617 10.6631 0.633681 0.729705 0.733249
0.00010 0.726195 -0.209239 1.65569 0.524617 10.6631 0.633681 0.729705 0.733249
0.00100 0.726195 -0.209239 1.65569 0.524617 10.6631 0.633681 0.729705 0.733249
0.01000 0.726195 -0.209239 1.65569 0.524617 10.6631 0.633681 0.729705 0.733249
0.10000 0.726195 -0.209239 1.65569 0.524617 10.6631 0.633681 0.729705 0.733249
6 euclidean 0.00001 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
0.00010 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
0.00100 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
0.01000 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
0.10000 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
l1 0.00001 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
0.00010 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
0.00100 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
0.01000 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
0.10000 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
l2 0.00001 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
0.00010 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
0.00100 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
0.01000 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
0.10000 0.674172 -0.209239 1.65569 0.495043 10.6631 0.623517 0.713712 0.75818
manhattan 0.00001 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
0.00010 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
0.00100 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
0.01000 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
0.10000 0.625709 -0.209239 1.65569 0.443202 10.6631 0.56895 0.670647 0.72254
cosine 0.00001 0.493831 -0.209239 1.65569 -0.00586756 10.6631 0.0968948 0.391011 0.323629
0.00010 0.493831 -0.209239 1.65569 -0.00586756 10.6631 0.0968948 0.391011 0.323629
0.00100 0.493831 -0.209239 1.65569 -0.00586756 10.6631 0.0968948 0.391011 0.323629
0.01000 0.493831 -0.209239 1.65569 -0.00586756 10.6631 0.0968948 0.391011 0.323629
0.10000 0.493831 -0.209239 1.65569 -0.00586756 10.6631 0.0968948 0.391011 0.323629
chebyshev 0.00001 0.533702 -0.209239 1.65569 0.382504 10.6631 0.506137 0.613158 0.720409
0.00010 0.533702 -0.209239 1.65569 0.382504 10.6631 0.506137 0.613158 0.720409
0.00100 0.533702 -0.209239 1.65569 0.382504 10.6631 0.506137 0.613158 0.720409
0.01000 0.533702 -0.209239 1.65569 0.382504 10.6631 0.506137 0.613158 0.720409
0.10000 0.533702 -0.209239 1.65569 0.382504 10.6631 0.506137 0.613158 0.720409
7 euclidean 0.00001 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
0.00010 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
0.00100 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
0.01000 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
0.10000 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
l1 0.00001 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
0.00010 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
0.00100 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
0.01000 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
0.10000 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
l2 0.00001 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
0.00010 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
0.00100 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
0.01000 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
0.10000 0.506561 -0.209239 1.65569 0.357739 10.6631 0.48536 0.592165 0.712586
manhattan 0.00001 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
0.00010 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
0.00100 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
0.01000 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
0.10000 0.507867 -0.209239 1.65569 0.346081 10.6631 0.482585 0.590425 0.705035
cosine 0.00001 0.465245 -0.209239 1.65569 0.0111799 10.6631 0.116254 0.386242 0.330175
0.00010 0.465245 -0.209239 1.65569 0.0111799 10.6631 0.116254 0.386242 0.330175
0.00100 0.465245 -0.209239 1.65569 0.0111799 10.6631 0.116254 0.386242 0.330175
0.01000 0.465245 -0.209239 1.65569 0.0111799 10.6631 0.116254 0.386242 0.330175
0.10000 0.465245 -0.209239 1.65569 0.0111799 10.6631 0.116254 0.386242 0.330175
chebyshev 0.00001 0.455632 -0.209239 1.65569 0.305363 10.6631 0.441399 0.550591 0.695552
0.00010 0.455632 -0.209239 1.65569 0.305363 10.6631 0.441399 0.550591 0.695552
0.00100 0.455632 -0.209239 1.65569 0.305363 10.6631 0.441399 0.550591 0.695552
0.01000 0.455632 -0.209239 1.65569 0.305363 10.6631 0.441399 0.550591 0.695552
0.10000 0.455632 -0.209239 1.65569 0.305363 10.6631 0.441399 0.550591 0.695552
8 euclidean 0.00001 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
0.00010 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
0.00100 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
0.01000 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
0.10000 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
l1 0.00001 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
0.00010 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
0.00100 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
0.01000 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
0.10000 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
l2 0.00001 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
0.00010 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
0.00100 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
0.01000 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
0.10000 0.38819 -0.209239 1.65569 0.254015 10.6631 0.384024 0.492738 0.674358
manhattan 0.00001 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
0.00010 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
0.00100 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
0.01000 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
0.10000 0.411434 -0.209239 1.65569 0.243194 10.6631 0.377584 0.496161 0.624835
cosine 0.00001 0.458147 -0.209239 1.65569 0.0142849 10.6631 0.127272 0.385887 0.333316
0.00010 0.458147 -0.209239 1.65569 0.0142849 10.6631 0.127272 0.385887 0.333316
0.00100 0.458147 -0.209239 1.65569 0.0142849 10.6631 0.127272 0.385887 0.333316
0.01000 0.458147 -0.209239 1.65569 0.0142849 10.6631 0.127272 0.385887 0.333316
0.10000 0.458147 -0.209239 1.65569 0.0142849 10.6631 0.127272 0.385887 0.333316
chebyshev 0.00001 0.34185 -0.209239 1.65569 0.20339 10.6631 0.335043 0.447163 0.646253
0.00010 0.34185 -0.209239 1.65569 0.20339 10.6631 0.335043 0.447163 0.646253
0.00100 0.34185 -0.209239 1.65569 0.20339 10.6631 0.335043 0.447163 0.646253
0.01000 0.34185 -0.209239 1.65569 0.20339 10.6631 0.335043 0.447163 0.646253
0.10000 0.34185 -0.209239 1.65569 0.20339 10.6631 0.335043 0.447163 0.646253
9 euclidean 0.00001 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
0.00010 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
0.00100 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
0.01000 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
0.10000 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
l1 0.00001 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
0.00010 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
0.00100 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
0.01000 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
0.10000 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
l2 0.00001 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
0.00010 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
0.00100 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
0.01000 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
0.10000 0.309363 -0.209239 1.65569 0.178866 10.6631 0.303874 0.41346 0.623141
manhattan 0.00001 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
0.00010 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
0.00100 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
0.01000 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
0.10000 0.267865 -0.209239 1.65569 0.146212 10.6631 0.272873 0.375524 0.627879
cosine 0.00001 0.45083 -0.209239 1.65569 0.0155859 10.6631 0.13514 0.384858 0.33573
0.00010 0.45083 -0.209239 1.65569 0.0155859 10.6631 0.13514 0.384858 0.33573
0.00100 0.45083 -0.209239 1.65569 0.0155859 10.6631 0.13514 0.384858 0.33573
0.01000 0.45083 -0.209239 1.65569 0.0155859 10.6631 0.13514 0.384858 0.33573
0.10000 0.45083 -0.209239 1.65569 0.0155859 10.6631 0.13514 0.384858 0.33573
chebyshev 0.00001 0.305185 -0.209239 1.65569 0.186614 10.6631 0.310815 0.4156 0.651207
0.00010 0.305185 -0.209239 1.65569 0.186614 10.6631 0.310815 0.4156 0.651207
0.00100 0.305185 -0.209239 1.65569 0.186614 10.6631 0.310815 0.4156 0.651207
0.01000 0.305185 -0.209239 1.65569 0.186614 10.6631 0.310815 0.4156 0.651207
0.10000 0.305185 -0.209239 1.65569 0.186614 10.6631 0.310815 0.4156 0.651207

Find best parameters for OPTICS Clustering

Davies_bouldin_score we have to minimize

In [47]:
metrics_dataframe_optics[metrics_min].style.apply(highlight_min)
Out[47]:
davies_bouldin_score
min_samples metrics epsilon
2 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
3 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
4 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
5 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
6 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
7 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
8 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
9 euclidean 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l1 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
l2 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
manhattan 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
cosine 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692
chebyshev 1e-05 1.655692
0.0001 1.655692
0.001 1.655692
0.01 1.655692
0.1 1.655692

Other metrics we have to maximize

In [48]:
metrics_dataframe_optics[metrics_max].style.apply(highlight_max)
Out[48]:
homogeneity_score v_measure_score completeness_score adjusted_mutual_info adjusted_rand_index calinski_harabasz_score silhouette_score
min_samples metrics epsilon
2 euclidean 1e-05 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
0.0001 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
0.001 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
0.01 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
0.1 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
l1 1e-05 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
0.0001 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
0.001 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
0.01 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
0.1 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
l2 1e-05 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
0.0001 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
0.001 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
0.01 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
0.1 0.835575 0.561198 0.422471 0.238611 0.018569 10.663137 -0.209239
manhattan 1e-05 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
0.0001 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
0.001 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
0.01 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
0.1 0.819782 0.559087 0.424192 0.242293 0.024395 10.663137 -0.209239
cosine 1e-05 0.727347 0.462433 0.338973 0.034872 -0.000169 10.663137 -0.209239
0.0001 0.727347 0.462433 0.338973 0.034872 -0.000169 10.663137 -0.209239
0.001 0.727347 0.462433 0.338973 0.034872 -0.000169 10.663137 -0.209239
0.01 0.727347 0.462433 0.338973 0.034872 -0.000169 10.663137 -0.209239
0.1 0.727347 0.462433 0.338973 0.034872 -0.000169 10.663137 -0.209239
chebyshev 1e-05 0.837425 0.563881 0.425041 0.244605 0.023863 10.663137 -0.209239
0.0001 0.837425 0.563881 0.425041 0.244605 0.023863 10.663137 -0.209239
0.001 0.837425 0.563881 0.425041 0.244605 0.023863 10.663137 -0.209239
0.01 0.837425 0.563881 0.425041 0.244605 0.023863 10.663137 -0.209239
0.1 0.837425 0.563881 0.425041 0.244605 0.023863 10.663137 -0.209239
3 euclidean 1e-05 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
0.0001 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
0.001 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
0.01 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
0.1 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
l1 1e-05 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
0.0001 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
0.001 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
0.01 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
0.1 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
l2 1e-05 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
0.0001 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
0.001 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
0.01 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
0.1 0.723650 0.587255 0.494122 0.368579 0.142826 10.663137 -0.209239
manhattan 1e-05 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
0.0001 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
0.001 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
0.01 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
0.1 0.749542 0.602697 0.503964 0.390759 0.159165 10.663137 -0.209239
cosine 1e-05 0.601349 0.421400 0.324343 0.050963 -0.002598 10.663137 -0.209239
0.0001 0.601349 0.421400 0.324343 0.050963 -0.002598 10.663137 -0.209239
0.001 0.601349 0.421400 0.324343 0.050963 -0.002598 10.663137 -0.209239
0.01 0.601349 0.421400 0.324343 0.050963 -0.002598 10.663137 -0.209239
0.1 0.601349 0.421400 0.324343 0.050963 -0.002598 10.663137 -0.209239
chebyshev 1e-05 0.752441 0.597431 0.495379 0.380402 0.135375 10.663137 -0.209239
0.0001 0.752441 0.597431 0.495379 0.380402 0.135375 10.663137 -0.209239
0.001 0.752441 0.597431 0.495379 0.380402 0.135375 10.663137 -0.209239
0.01 0.752441 0.597431 0.495379 0.380402 0.135375 10.663137 -0.209239
0.1 0.752441 0.597431 0.495379 0.380402 0.135375 10.663137 -0.209239
4 euclidean 1e-05 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
0.0001 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
0.001 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
0.01 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
0.1 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
l1 1e-05 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
0.0001 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
0.001 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
0.01 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
0.1 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
l2 1e-05 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
0.0001 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
0.001 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
0.01 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
0.1 0.705554 0.656940 0.614594 0.513440 0.347648 10.663137 -0.209239
manhattan 1e-05 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
0.0001 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
0.001 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
0.01 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
0.1 0.741969 0.678945 0.625789 0.543465 0.380037 10.663137 -0.209239
cosine 1e-05 0.558866 0.415329 0.330456 0.085944 0.007322 10.663137 -0.209239
0.0001 0.558866 0.415329 0.330456 0.085944 0.007322 10.663137 -0.209239
0.001 0.558866 0.415329 0.330456 0.085944 0.007322 10.663137 -0.209239
0.01 0.558866 0.415329 0.330456 0.085944 0.007322 10.663137 -0.209239
0.1 0.558866 0.415329 0.330456 0.085944 0.007322 10.663137 -0.209239
chebyshev 1e-05 0.747669 0.676667 0.617980 0.536490 0.365002 10.663137 -0.209239
0.0001 0.747669 0.676667 0.617980 0.536490 0.365002 10.663137 -0.209239
0.001 0.747669 0.676667 0.617980 0.536490 0.365002 10.663137 -0.209239
0.01 0.747669 0.676667 0.617980 0.536490 0.365002 10.663137 -0.209239
0.1 0.747669 0.676667 0.617980 0.536490 0.365002 10.663137 -0.209239
5 euclidean 1e-05 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
0.0001 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
0.001 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
0.01 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
0.1 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
l1 1e-05 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
0.0001 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
0.001 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
0.01 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
0.1 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
l2 1e-05 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
0.0001 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
0.001 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
0.01 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
0.1 0.955963 0.960209 0.964493 0.946037 0.920004 10.663137 -0.209239
manhattan 1e-05 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
0.0001 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
0.001 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
0.01 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
0.1 0.751716 0.745028 0.738458 0.653711 0.536624 10.663137 -0.209239
cosine 1e-05 0.510696 0.395365 0.322528 0.085849 -0.000356 10.663137 -0.209239
0.0001 0.510696 0.395365 0.322528 0.085849 -0.000356 10.663137 -0.209239
0.001 0.510696 0.395365 0.322528 0.085849 -0.000356 10.663137 -0.209239
0.01 0.510696 0.395365 0.322528 0.085849 -0.000356 10.663137 -0.209239
0.1 0.510696 0.395365 0.322528 0.085849 -0.000356 10.663137 -0.209239
chebyshev 1e-05 0.726195 0.729705 0.733249 0.633681 0.524617 10.663137 -0.209239
0.0001 0.726195 0.729705 0.733249 0.633681 0.524617 10.663137 -0.209239
0.001 0.726195 0.729705 0.733249 0.633681 0.524617 10.663137 -0.209239
0.01 0.726195 0.729705 0.733249 0.633681 0.524617 10.663137 -0.209239
0.1 0.726195 0.729705 0.733249 0.633681 0.524617 10.663137 -0.209239
6 euclidean 1e-05 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
0.0001 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
0.001 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
0.01 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
0.1 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
l1 1e-05 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
0.0001 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
0.001 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
0.01 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
0.1 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
l2 1e-05 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
0.0001 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
0.001 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
0.01 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
0.1 0.674172 0.713712 0.758180 0.623517 0.495043 10.663137 -0.209239
manhattan 1e-05 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
0.0001 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
0.001 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
0.01 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
0.1 0.625709 0.670647 0.722540 0.568950 0.443202 10.663137 -0.209239
cosine 1e-05 0.493831 0.391011 0.323629 0.096895 -0.005868 10.663137 -0.209239
0.0001 0.493831 0.391011 0.323629 0.096895 -0.005868 10.663137 -0.209239
0.001 0.493831 0.391011 0.323629 0.096895 -0.005868 10.663137 -0.209239
0.01 0.493831 0.391011 0.323629 0.096895 -0.005868 10.663137 -0.209239
0.1 0.493831 0.391011 0.323629 0.096895 -0.005868 10.663137 -0.209239
chebyshev 1e-05 0.533702 0.613158 0.720409 0.506137 0.382504 10.663137 -0.209239
0.0001 0.533702 0.613158 0.720409 0.506137 0.382504 10.663137 -0.209239
0.001 0.533702 0.613158 0.720409 0.506137 0.382504 10.663137 -0.209239
0.01 0.533702 0.613158 0.720409 0.506137 0.382504 10.663137 -0.209239
0.1 0.533702 0.613158 0.720409 0.506137 0.382504 10.663137 -0.209239
7 euclidean 1e-05 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
0.0001 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
0.001 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
0.01 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
0.1 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
l1 1e-05 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
0.0001 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
0.001 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
0.01 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
0.1 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
l2 1e-05 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
0.0001 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
0.001 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
0.01 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
0.1 0.506561 0.592165 0.712586 0.485360 0.357739 10.663137 -0.209239
manhattan 1e-05 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
0.0001 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
0.001 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
0.01 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
0.1 0.507867 0.590425 0.705035 0.482585 0.346081 10.663137 -0.209239
cosine 1e-05 0.465245 0.386242 0.330175 0.116254 0.011180 10.663137 -0.209239
0.0001 0.465245 0.386242 0.330175 0.116254 0.011180 10.663137 -0.209239
0.001 0.465245 0.386242 0.330175 0.116254 0.011180 10.663137 -0.209239
0.01 0.465245 0.386242 0.330175 0.116254 0.011180 10.663137 -0.209239
0.1 0.465245 0.386242 0.330175 0.116254 0.011180 10.663137 -0.209239
chebyshev 1e-05 0.455632 0.550591 0.695552 0.441399 0.305363 10.663137 -0.209239
0.0001 0.455632 0.550591 0.695552 0.441399 0.305363 10.663137 -0.209239
0.001 0.455632 0.550591 0.695552 0.441399 0.305363 10.663137 -0.209239
0.01 0.455632 0.550591 0.695552 0.441399 0.305363 10.663137 -0.209239
0.1 0.455632 0.550591 0.695552 0.441399 0.305363 10.663137 -0.209239
8 euclidean 1e-05 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
0.0001 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
0.001 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
0.01 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
0.1 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
l1 1e-05 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
0.0001 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
0.001 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
0.01 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
0.1 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
l2 1e-05 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
0.0001 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
0.001 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
0.01 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
0.1 0.388190 0.492738 0.674358 0.384024 0.254015 10.663137 -0.209239
manhattan 1e-05 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
0.0001 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
0.001 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
0.01 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
0.1 0.411434 0.496161 0.624835 0.377584 0.243194 10.663137 -0.209239
cosine 1e-05 0.458147 0.385887 0.333316 0.127272 0.014285 10.663137 -0.209239
0.0001 0.458147 0.385887 0.333316 0.127272 0.014285 10.663137 -0.209239
0.001 0.458147 0.385887 0.333316 0.127272 0.014285 10.663137 -0.209239
0.01 0.458147 0.385887 0.333316 0.127272 0.014285 10.663137 -0.209239
0.1 0.458147 0.385887 0.333316 0.127272 0.014285 10.663137 -0.209239
chebyshev 1e-05 0.341850 0.447163 0.646253 0.335043 0.203390 10.663137 -0.209239
0.0001 0.341850 0.447163 0.646253 0.335043 0.203390 10.663137 -0.209239
0.001 0.341850 0.447163 0.646253 0.335043 0.203390 10.663137 -0.209239
0.01 0.341850 0.447163 0.646253 0.335043 0.203390 10.663137 -0.209239
0.1 0.341850 0.447163 0.646253 0.335043 0.203390 10.663137 -0.209239
9 euclidean 1e-05 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
0.0001 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
0.001 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
0.01 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
0.1 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
l1 1e-05 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
0.0001 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
0.001 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
0.01 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
0.1 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
l2 1e-05 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
0.0001 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
0.001 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
0.01 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
0.1 0.309363 0.413460 0.623141 0.303874 0.178866 10.663137 -0.209239
manhattan 1e-05 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
0.0001 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
0.001 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
0.01 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
0.1 0.267865 0.375524 0.627879 0.272873 0.146212 10.663137 -0.209239
cosine 1e-05 0.450830 0.384858 0.335730 0.135140 0.015586 10.663137 -0.209239
0.0001 0.450830 0.384858 0.335730 0.135140 0.015586 10.663137 -0.209239
0.001 0.450830 0.384858 0.335730 0.135140 0.015586 10.663137 -0.209239
0.01 0.450830 0.384858 0.335730 0.135140 0.015586 10.663137 -0.209239
0.1 0.450830 0.384858 0.335730 0.135140 0.015586 10.663137 -0.209239
chebyshev 1e-05 0.305185 0.415600 0.651207 0.310815 0.186614 10.663137 -0.209239
0.0001 0.305185 0.415600 0.651207 0.310815 0.186614 10.663137 -0.209239
0.001 0.305185 0.415600 0.651207 0.310815 0.186614 10.663137 -0.209239
0.01 0.305185 0.415600 0.651207 0.310815 0.186614 10.663137 -0.209239
0.1 0.305185 0.415600 0.651207 0.310815 0.186614 10.663137 -0.209239

Seems like 4 clusters and Euclidean or L2 are the best for OPTICS algorithm. Epsilon doesn't influence on change metrics values.

Agglomerative Clustering

Experiments with number of clusters and distance metrics

In [49]:
clusters_range = range(2, 10)
distance_metrics = ('euclidean', 'l1', 'l2', 'manhattan', 'cosine')
In [50]:
agglomerative_clustering_labels_mapping = defaultdict(dict)

index = pd.MultiIndex.from_product((clusters_range, distance_metrics))

metrics_dataframe_agglomerative = pd.DataFrame(index=index, columns=clustering_metrics_titles)
In [51]:
for nclusters, distance_metric in itertools.product(clusters_range, distance_metrics):
    algorithm = AgglomerativeClustering(n_clusters=nclusters, affinity=distance_metric, linkage='average')
    agglomerative_predictions = algorithm.fit_predict(data)
    
    agglomerative_clustering_labels_mapping[nclusters][distance_metric] = agglomerative_predictions
    
    for metric, metric_title in zip(clustering_metrics, clustering_metrics_titles):
        if metric_title not in ('silhouette_score', 'davies_bouldin_score', 'calinski_harabasz_score'):
            metrics_dataframe_agglomerative.loc[(nclusters, distance_metric), metric_title] = metric(
                labels, agglomerative_predictions)
        else:
            metrics_dataframe_agglomerative.loc[(nclusters, distance_metric), metric_title] = metric(data, labels)
In [52]:
metrics_dataframe_agglomerative.index.names = ['nclusters', 'affinity']
metrics_dataframe_agglomerative
Out[52]:
homogeneity_score silhouette_score davies_bouldin_score adjusted_rand_index calinski_harabasz_score adjusted_mutual_info v_measure_score completeness_score
nclusters affinity
2 euclidean 0.000437997 -0.209239 1.65569 -0.00275536 10.6631 -0.00190102 0.000871643 0.0877418
l1 0.000218846 -0.209239 1.65569 -0.00138003 10.6631 -0.00123876 0.000436497 0.079989
l2 0.000437997 -0.209239 1.65569 -0.00275536 10.6631 -0.00190102 0.000871643 0.0877418
manhattan 0.000218846 -0.209239 1.65569 -0.00138003 10.6631 -0.00123876 0.000436497 0.079989
cosine 0.104759 -0.209239 1.65569 -0.00717091 10.6631 0.155184 0.170542 0.458369
3 euclidean 0.0158739 -0.209239 1.65569 -0.00356124 10.6631 0.0156289 0.0305198 0.39451
l1 0.112308 -0.209239 1.65569 0.0019127 10.6631 0.164905 0.180853 0.464125
l2 0.0158739 -0.209239 1.65569 -0.00356124 10.6631 0.0156289 0.0305198 0.39451
manhattan 0.112308 -0.209239 1.65569 0.0019127 10.6631 0.164905 0.180853 0.464125
cosine 0.126093 -0.209239 1.65569 -0.0156452 10.6631 0.167967 0.195924 0.439104
4 euclidean 0.0180388 -0.209239 1.65569 -0.00356868 10.6631 0.015776 0.034525 0.401105
l1 0.144623 -0.209239 1.65569 0.00675767 10.6631 0.192959 0.220541 0.464238
l2 0.0180388 -0.209239 1.65569 -0.00356868 10.6631 0.015776 0.034525 0.401105
manhattan 0.144623 -0.209239 1.65569 0.00675767 10.6631 0.192959 0.220541 0.464238
cosine 0.192417 -0.209239 1.65569 -0.00463879 10.6631 0.232211 0.268141 0.442145
5 euclidean 0.126127 -0.209239 1.65569 -0.00182424 10.6631 0.170065 0.197367 0.453537
l1 0.179476 -0.209239 1.65569 -0.024626 10.6631 0.217509 0.255725 0.444616
l2 0.126127 -0.209239 1.65569 -0.00182424 10.6631 0.170065 0.197367 0.453537
manhattan 0.179476 -0.209239 1.65569 -0.024626 10.6631 0.217509 0.255725 0.444616
cosine 0.223445 -0.209239 1.65569 -0.0096054 10.6631 0.250904 0.296308 0.439686
6 euclidean 0.164104 -0.209239 1.65569 -0.00906657 10.6631 0.20218 0.240161 0.447613
l1 0.180344 -0.209239 1.65569 -0.0251863 10.6631 0.215481 0.256004 0.441026
l2 0.164104 -0.209239 1.65569 -0.00906657 10.6631 0.20218 0.240161 0.447613
manhattan 0.180344 -0.209239 1.65569 -0.0251863 10.6631 0.215481 0.256004 0.441026
cosine 0.255218 -0.209239 1.65569 -0.00159601 10.6631 0.269808 0.322809 0.439098
7 euclidean 0.170644 -0.209239 1.65569 -0.0118611 10.6631 0.200783 0.246049 0.440851
l1 0.180879 -0.209239 1.65569 -0.0268318 10.6631 0.212677 0.255667 0.435897
l2 0.170644 -0.209239 1.65569 -0.0118611 10.6631 0.200783 0.246049 0.440851
manhattan 0.180879 -0.209239 1.65569 -0.0268318 10.6631 0.212677 0.255667 0.435897
cosine 0.266096 -0.209239 1.65569 -0.00358133 10.6631 0.270759 0.330466 0.435916
8 euclidean 0.207004 -0.209239 1.65569 -0.0302543 10.6631 0.227058 0.280657 0.435674
l1 0.214953 -0.209239 1.65569 -0.0264911 10.6631 0.236308 0.287495 0.433944
l2 0.207004 -0.209239 1.65569 -0.0302543 10.6631 0.227058 0.280657 0.435674
manhattan 0.214953 -0.209239 1.65569 -0.0264911 10.6631 0.236308 0.287495 0.433944
cosine 0.292581 -0.209239 1.65569 -0.0102035 10.6631 0.283028 0.349638 0.434341
9 euclidean 0.227325 -0.209239 1.65569 -0.037543 10.6631 0.237106 0.297703 0.431199
l1 0.252884 -0.209239 1.65569 -0.0287025 10.6631 0.26251 0.320768 0.438472
l2 0.227325 -0.209239 1.65569 -0.037543 10.6631 0.237106 0.297703 0.431199
manhattan 0.252884 -0.209239 1.65569 -0.0287025 10.6631 0.26251 0.320768 0.438472
cosine 0.311223 -0.209239 1.65569 -0.0112748 10.6631 0.289587 0.362611 0.434326

Find best nclusters and affinity for Agglomerative Clustering

Davies_bouldin_score we have to minimize

In [53]:
metrics_dataframe_agglomerative[metrics_min].style.apply(highlight_min)
Out[53]:
davies_bouldin_score
nclusters affinity
2 euclidean 1.655692
l1 1.655692
l2 1.655692
manhattan 1.655692
cosine 1.655692
3 euclidean 1.655692
l1 1.655692
l2 1.655692
manhattan 1.655692
cosine 1.655692
4 euclidean 1.655692
l1 1.655692
l2 1.655692
manhattan 1.655692
cosine 1.655692
5 euclidean 1.655692
l1 1.655692
l2 1.655692
manhattan 1.655692
cosine 1.655692
6 euclidean 1.655692
l1 1.655692
l2 1.655692
manhattan 1.655692
cosine 1.655692
7 euclidean 1.655692
l1 1.655692
l2 1.655692
manhattan 1.655692
cosine 1.655692
8 euclidean 1.655692
l1 1.655692
l2 1.655692
manhattan 1.655692
cosine 1.655692
9 euclidean 1.655692
l1 1.655692
l2 1.655692
manhattan 1.655692
cosine 1.655692

Other metrics we have to maximize

In [54]:
metrics_dataframe_agglomerative[metrics_max].style.apply(highlight_max)
Out[54]:
homogeneity_score v_measure_score completeness_score adjusted_mutual_info adjusted_rand_index calinski_harabasz_score silhouette_score
nclusters affinity
2 euclidean 0.000438 0.000872 0.087742 -0.001901 -0.002755 10.663137 -0.209239
l1 0.000219 0.000436 0.079989 -0.001239 -0.001380 10.663137 -0.209239
l2 0.000438 0.000872 0.087742 -0.001901 -0.002755 10.663137 -0.209239
manhattan 0.000219 0.000436 0.079989 -0.001239 -0.001380 10.663137 -0.209239
cosine 0.104759 0.170542 0.458369 0.155184 -0.007171 10.663137 -0.209239
3 euclidean 0.015874 0.030520 0.394510 0.015629 -0.003561 10.663137 -0.209239
l1 0.112308 0.180853 0.464125 0.164905 0.001913 10.663137 -0.209239
l2 0.015874 0.030520 0.394510 0.015629 -0.003561 10.663137 -0.209239
manhattan 0.112308 0.180853 0.464125 0.164905 0.001913 10.663137 -0.209239
cosine 0.126093 0.195924 0.439104 0.167967 -0.015645 10.663137 -0.209239
4 euclidean 0.018039 0.034525 0.401105 0.015776 -0.003569 10.663137 -0.209239
l1 0.144623 0.220541 0.464238 0.192959 0.006758 10.663137 -0.209239
l2 0.018039 0.034525 0.401105 0.015776 -0.003569 10.663137 -0.209239
manhattan 0.144623 0.220541 0.464238 0.192959 0.006758 10.663137 -0.209239
cosine 0.192417 0.268141 0.442145 0.232211 -0.004639 10.663137 -0.209239
5 euclidean 0.126127 0.197367 0.453537 0.170065 -0.001824 10.663137 -0.209239
l1 0.179476 0.255725 0.444616 0.217509 -0.024626 10.663137 -0.209239
l2 0.126127 0.197367 0.453537 0.170065 -0.001824 10.663137 -0.209239
manhattan 0.179476 0.255725 0.444616 0.217509 -0.024626 10.663137 -0.209239
cosine 0.223445 0.296308 0.439686 0.250904 -0.009605 10.663137 -0.209239
6 euclidean 0.164104 0.240161 0.447613 0.202180 -0.009067 10.663137 -0.209239
l1 0.180344 0.256004 0.441026 0.215481 -0.025186 10.663137 -0.209239
l2 0.164104 0.240161 0.447613 0.202180 -0.009067 10.663137 -0.209239
manhattan 0.180344 0.256004 0.441026 0.215481 -0.025186 10.663137 -0.209239
cosine 0.255218 0.322809 0.439098 0.269808 -0.001596 10.663137 -0.209239
7 euclidean 0.170644 0.246049 0.440851 0.200783 -0.011861 10.663137 -0.209239
l1 0.180879 0.255667 0.435897 0.212677 -0.026832 10.663137 -0.209239
l2 0.170644 0.246049 0.440851 0.200783 -0.011861 10.663137 -0.209239
manhattan 0.180879 0.255667 0.435897 0.212677 -0.026832 10.663137 -0.209239
cosine 0.266096 0.330466 0.435916 0.270759 -0.003581 10.663137 -0.209239
8 euclidean 0.207004 0.280657 0.435674 0.227058 -0.030254 10.663137 -0.209239
l1 0.214953 0.287495 0.433944 0.236308 -0.026491 10.663137 -0.209239
l2 0.207004 0.280657 0.435674 0.227058 -0.030254 10.663137 -0.209239
manhattan 0.214953 0.287495 0.433944 0.236308 -0.026491 10.663137 -0.209239
cosine 0.292581 0.349638 0.434341 0.283028 -0.010204 10.663137 -0.209239
9 euclidean 0.227325 0.297703 0.431199 0.237106 -0.037543 10.663137 -0.209239
l1 0.252884 0.320768 0.438472 0.262510 -0.028702 10.663137 -0.209239
l2 0.227325 0.297703 0.431199 0.237106 -0.037543 10.663137 -0.209239
manhattan 0.252884 0.320768 0.438472 0.262510 -0.028702 10.663137 -0.209239
cosine 0.311223 0.362611 0.434326 0.289587 -0.011275 10.663137 -0.209239

Seems like 9 clusters and cosine are the best for Agglomerative Clustering algorithm

Vizualize clusters for each parameter

In [55]:
fig, axs = plt.subplots(nrows=len(clusters_range), ncols=len(distance_metrics), figsize=(100, 120))

idx = 0

for i, data_agg in enumerate(agglomerative_clustering_labels_mapping.items()):
    nclusters, data_dict = data_agg
    for j, data_agg1 in enumerate(data_dict.items()):
        affinity, labels = data_agg1
        colors_mapping = [(item/255.) for item in labels]
        axs[i][j].scatter(data[:, 0], data[:, 1], c=colors_mapping);
        axs[i][j].set_title('Agglomerative Clustering, number of selected clusters: {}, affinity: {}'.format(
            nclusters, affinity))
In [ ]:
 
In [ ]:
 

Dataset 2

dataset for task about heart attack

In [70]:
from sklearn.decomposition import PCA
In [72]:
dataset2 = pd.read_csv('heart.csv')
In [73]:
dataset2.head()
Out[73]:
age sex cp trestbps chol fbs restecg thalach exang oldpeak slope ca thal target
0 63 1 3 145 233 1 0 150 0 2.3 0 0 1 1
1 37 1 2 130 250 0 1 187 0 3.5 0 0 2 1
2 41 0 1 130 204 0 0 172 0 1.4 2 0 2 1
3 56 1 1 120 236 0 1 178 0 0.8 2 0 2 1
4 57 0 0 120 354 0 1 163 1 0.6 2 0 2 1
In [74]:
dataset_task2 = dataset2.iloc[:,0:-1]
dataset_task2.shape
Out[74]:
(297, 13)
In [75]:
labels = dataset2['target']
In [76]:
pca = PCA(n_components=2)
In [77]:
dataset_2d = pca.fit_transform(dataset_task2)

Calculate metrics for each algorithm

In [78]:
labels_mapping = {}

metrics_dataframe = pd.DataFrame(index=clustering_algorithms_titles, columns=clustering_metrics_titles)

for clustering_algorithm, clustering_algorithms_title in zip(clustering_algorithms, clustering_algorithms_titles):
    algorithm = clustering_algorithm()
    tmp_predictions = algorithm.fit_predict(dataset_2d)
    
    labels_mapping[clustering_algorithms_title] = tmp_predictions
    
    for metric, metric_title in zip(clustering_metrics, clustering_metrics_titles):
        if metric_title not in ('silhouette_score', 'davies_bouldin_score', 'calinski_harabasz_score'):
            metrics_dataframe.loc[clustering_algorithms_title, metric_title] = metric(labels, tmp_predictions)
        else:
            metrics_dataframe.loc[clustering_algorithms_title, metric_title] = metric(dataset_2d, labels)
In [79]:
metrics_dataframe.index.name = 'clustering_algorithm'
metrics_dataframe
Out[79]:
homogeneity_score silhouette_score davies_bouldin_score adjusted_rand_index calinski_harabasz_score adjusted_mutual_info v_measure_score completeness_score
clustering_algorithm
DBSCAN 5.63966e-16 0.0503427 4.06686 0 11.8638 3.47169e-15 1.12793e-15 1
AgglomerativeClustering 0.0211148 0.0503427 4.06686 0.0321577 11.8638 0.0210758 0.023793 0.0272495
OPTICS 0.102684 0.0503427 4.06686 0.0161423 11.8638 0.0285888 0.0530897 0.0357993

Find best algorithms for each metric of clusterization

Davies_bouldin_score we have to minimize

In [80]:
metrics_dataframe[metrics_min].style.apply(highlight_min)
Out[80]:
davies_bouldin_score
clustering_algorithm
DBSCAN 4.066858
AgglomerativeClustering 4.066858
OPTICS 4.066858

Other metrics we have to maximize

In [81]:
metrics_dataframe[metrics_max].style.apply(highlight_max)
Out[81]:
homogeneity_score v_measure_score completeness_score adjusted_mutual_info adjusted_rand_index calinski_harabasz_score silhouette_score
clustering_algorithm
DBSCAN 0.000000 0.000000 1.000000 0.000000 0.000000 11.863777 0.050343
AgglomerativeClustering 0.021115 0.023793 0.027249 0.021076 0.032158 11.863777 0.050343
OPTICS 0.102684 0.053090 0.035799 0.028589 0.016142 11.863777 0.050343

OPTICS seems to be the best algorithm, according to clusterization metrics

Vizualize clusters for each method

In [82]:
fig, axs = plt.subplots(nrows=len(clustering_algorithms_titles), ncols=1, figsize=(10, 20))

idx = 0

for clustering_algorithm, labels in labels_mapping.items():
    colors_mapping = [(item/255.) for item in labels]
    axs[idx].scatter(dataset_2d[:, 0], dataset_2d[:, 1], c=colors_mapping);
    axs[idx].set_title('{}, number of selected clusters: {}'.format(clustering_algorithm, len(set(labels))))
    
    idx += 1

According to this visualisation we can say that the best algorithm is Agglomerative Clustering, such as we know that this task have to have only two clusters.

Thus we consider that the best metrics is adjusted_rand_index.

Experiments with parameters

DBSCAN

Experiments with min samples, metric and epsilon

In [83]:
min_samples_range = range(2, 10)
distance_metrics = ('euclidean', 'l1', 'l2', 'manhattan', 'cosine', 'chebyshev')
epsilons_range = (1e-5, 1e-4, 1e-3, 0.01, 0.1)
In [84]:
dbscan_clustering_labels_mapping = {eps: {metrics: {samples: None for samples in min_samples_range} 
                                     for metrics in distance_metrics} 
                                    for eps in epsilons_range}


index = pd.MultiIndex.from_product((min_samples_range, distance_metrics, epsilons_range))

metrics_dataframe_dbscan = pd.DataFrame(index=index, columns=clustering_metrics_titles)
In [85]:
for min_samples, distance_metric, epsilon in itertools.product(min_samples_range, distance_metrics, epsilons_range):
    algorithm = DBSCAN(min_samples=min_samples, metric=distance_metric, eps=epsilon)
    dbscan_predictions = algorithm.fit_predict(dataset_2d)
    
    dbscan_clustering_labels_mapping[epsilon][distance_metric][min_samples] = dbscan_predictions
    
    for metric, metric_title in zip(clustering_metrics, clustering_metrics_titles):
        if metric_title not in ('silhouette_score', 'davies_bouldin_score', 'calinski_harabasz_score'):
            metrics_dataframe_dbscan.loc[(min_samples, distance_metric, epsilon), metric_title] = metric(
                labels, dbscan_predictions)
        else:
            metrics_dataframe_dbscan.loc[(min_samples, distance_metric, epsilon), metric_title] = metric(dataset_2d, labels)
In [86]:
metrics_dataframe_dbscan.index.names = ['min_samples', 'metrics', 'epsilon']
metrics_dataframe_dbscan
Out[86]:
homogeneity_score silhouette_score davies_bouldin_score adjusted_rand_index calinski_harabasz_score adjusted_mutual_info v_measure_score completeness_score
min_samples metrics epsilon
2 euclidean 0.00001 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00010 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00100 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.01000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.10000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
l1 0.00001 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00010 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00100 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.01000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.10000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
l2 0.00001 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00010 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00100 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.01000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.10000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
manhattan 0.00001 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00010 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00100 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.01000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.10000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
cosine 0.00001 0.319239 -0.134175 2.48296 -0.00619431 4.65201 0.0520699 0.303988 0.290127
0.00010 0.555946 -0.134175 2.48296 0.0249378 4.65201 0.127591 0.399962 0.31233
0.00100 0.403027 -0.134175 2.48296 0.00514749 4.65201 0.229454 0.377461 0.354946
0.01000 0.0179048 -0.134175 2.48296 -0.00994901 4.65201 0.0117829 0.0335072 0.26058
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
chebyshev 0.00001 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00010 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.00100 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.01000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
0.10000 0.00207496 -0.134175 2.48296 -0.00915705 4.65201 -0.00620542 0.00406681 0.10154
3 euclidean 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l1 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l2 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
manhattan 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
cosine 0.00001 0.0837301 -0.134175 2.48296 -0.0687178 4.65201 -0.0125781 0.11933 0.207591
0.00010 0.357755 -0.134175 2.48296 -0.00832641 4.65201 0.100954 0.317651 0.285632
0.00100 0.398764 -0.134175 2.48296 0.00503494 4.65201 0.229236 0.374966 0.353848
0.01000 0.0179048 -0.134175 2.48296 -0.00994901 4.65201 0.0117829 0.0335072 0.26058
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
chebyshev 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
4 euclidean 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l1 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l2 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
manhattan 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
cosine 0.00001 0.02078 -0.134175 2.48296 -0.0470182 4.65201 -0.0207109 0.0361087 0.137642
0.00010 0.213861 -0.134175 2.48296 -0.0100482 4.65201 0.0598423 0.234146 0.258683
0.00100 0.380575 -0.134175 2.48296 -0.00353217 4.65201 0.21174 0.357446 0.336966
0.01000 0.0179048 -0.134175 2.48296 -0.00994901 4.65201 0.0117829 0.0335072 0.26058
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
chebyshev 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
5 euclidean 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l1 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l2 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
manhattan 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
cosine 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 0.106181 -0.134175 2.48296 0.000790805 4.65201 0.0387559 0.148086 0.244632
0.00100 0.366277 -0.134175 2.48296 0.022441 4.65201 0.23562 0.353601 0.341772
0.01000 0.0600757 -0.134175 2.48296 0.0256544 4.65201 0.0719317 0.107432 0.507405
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
chebyshev 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
6 euclidean 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l1 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l2 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
manhattan 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
cosine 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 0.0644181 -0.134175 2.48296 0.0143082 4.65201 0.0399819 0.105265 0.287684
0.00100 0.288513 -0.134175 2.48296 0.0626053 4.65201 0.254221 0.325853 0.374295
0.01000 0.0600757 -0.134175 2.48296 0.0256544 4.65201 0.0719317 0.107432 0.507405
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
chebyshev 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
7 euclidean 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l1 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l2 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
manhattan 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
cosine 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 0.00689494 -0.134175 2.48296 -0.021699 4.65201 -0.00681434 0.0130527 0.122077
0.00100 0.266354 -0.134175 2.48296 0.0194318 4.65201 0.227577 0.305382 0.357811
0.01000 0.235385 -0.134175 2.48296 0.0155813 4.65201 0.236797 0.298425 0.407584
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
chebyshev 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
8 euclidean 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l1 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l2 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
manhattan 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
cosine 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 0.259745 -0.134175 2.48296 0.0143858 4.65201 0.179833 0.286253 0.318786
0.01000 0.270518 -0.134175 2.48296 0.0418605 4.65201 0.261577 0.330075 0.42326
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
chebyshev 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
9 euclidean 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l1 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
l2 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
manhattan 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
cosine 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 0.266182 -0.134175 2.48296 0.0230948 4.65201 0.177463 0.291516 0.322181
0.01000 0.23872 -0.134175 2.48296 0.0421516 4.65201 0.261726 0.306462 0.427883
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
chebyshev 0.00001 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00010 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.00100 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.01000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1
0.10000 1.40442e-17 -0.134175 2.48296 0 4.65201 8.25629e-17 2.80884e-17 1

Find best parameters for DBSCAN Clustering

Davies_bouldin_score we have to minimize

In [87]:
metrics_dataframe_dbscan[metrics_min].style.apply(highlight_min)
Out[87]:
davies_bouldin_score
min_samples metrics epsilon
2 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
3 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
4 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
5 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
6 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
7 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
8 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
9 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960

Other metrics we have to maximize

In [88]:
metrics_dataframe_dbscan[metrics_max].style.apply(highlight_max)
Out[88]:
homogeneity_score v_measure_score completeness_score adjusted_mutual_info adjusted_rand_index calinski_harabasz_score silhouette_score
min_samples metrics epsilon
2 euclidean 1e-05 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.0001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.01 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.1 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
l1 1e-05 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.0001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.01 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.1 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
l2 1e-05 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.0001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.01 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.1 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
manhattan 1e-05 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.0001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.01 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.1 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
cosine 1e-05 0.319239 0.303988 0.290127 0.052070 -0.006194 4.652007 -0.134175
0.0001 0.555946 0.399962 0.312330 0.127591 0.024938 4.652007 -0.134175
0.001 0.403027 0.377461 0.354946 0.229454 0.005147 4.652007 -0.134175
0.01 0.017905 0.033507 0.260580 0.011783 -0.009949 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
chebyshev 1e-05 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.0001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.001 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.01 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
0.1 0.002075 0.004067 0.101540 -0.006205 -0.009157 4.652007 -0.134175
3 euclidean 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l1 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l2 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
manhattan 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
cosine 1e-05 0.083730 0.119330 0.207591 -0.012578 -0.068718 4.652007 -0.134175
0.0001 0.357755 0.317651 0.285632 0.100954 -0.008326 4.652007 -0.134175
0.001 0.398764 0.374966 0.353848 0.229236 0.005035 4.652007 -0.134175
0.01 0.017905 0.033507 0.260580 0.011783 -0.009949 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
chebyshev 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
4 euclidean 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l1 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l2 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
manhattan 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
cosine 1e-05 0.020780 0.036109 0.137642 -0.020711 -0.047018 4.652007 -0.134175
0.0001 0.213861 0.234146 0.258683 0.059842 -0.010048 4.652007 -0.134175
0.001 0.380575 0.357446 0.336966 0.211740 -0.003532 4.652007 -0.134175
0.01 0.017905 0.033507 0.260580 0.011783 -0.009949 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
chebyshev 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
5 euclidean 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l1 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l2 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
manhattan 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
cosine 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.106181 0.148086 0.244632 0.038756 0.000791 4.652007 -0.134175
0.001 0.366277 0.353601 0.341772 0.235620 0.022441 4.652007 -0.134175
0.01 0.060076 0.107432 0.507405 0.071932 0.025654 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
chebyshev 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
6 euclidean 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l1 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l2 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
manhattan 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
cosine 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.064418 0.105265 0.287684 0.039982 0.014308 4.652007 -0.134175
0.001 0.288513 0.325853 0.374295 0.254221 0.062605 4.652007 -0.134175
0.01 0.060076 0.107432 0.507405 0.071932 0.025654 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
chebyshev 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
7 euclidean 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l1 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l2 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
manhattan 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
cosine 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.006895 0.013053 0.122077 -0.006814 -0.021699 4.652007 -0.134175
0.001 0.266354 0.305382 0.357811 0.227577 0.019432 4.652007 -0.134175
0.01 0.235385 0.298425 0.407584 0.236797 0.015581 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
chebyshev 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
8 euclidean 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l1 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l2 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
manhattan 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
cosine 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.259745 0.286253 0.318786 0.179833 0.014386 4.652007 -0.134175
0.01 0.270518 0.330075 0.423260 0.261577 0.041861 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
chebyshev 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
9 euclidean 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l1 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
l2 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
manhattan 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
cosine 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.266182 0.291516 0.322181 0.177463 0.023095 4.652007 -0.134175
0.01 0.238720 0.306462 0.427883 0.261726 0.042152 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
chebyshev 1e-05 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.0001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.001 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.01 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175
0.1 0.000000 0.000000 1.000000 0.000000 0.000000 4.652007 -0.134175

Seems like 2 clusters, manhattan and epsilon 1e-04 metrics are the best for DBSCAN algorithm

OPTICS

Experiments with min samples, metric and epsilon

In [89]:
min_samples_range = range(2, 10)
distance_metrics = ('euclidean', 'l1', 'l2', 'manhattan', 'cosine', 'chebyshev')

epsilons_range = (1e-5, 1e-4, 1e-3, 0.01, 0.1)
In [90]:
optics_clustering_labels_mapping = {eps: {metrics: {samples: None for samples in min_samples_range} 
                                     for metrics in distance_metrics} 
                                    for eps in epsilons_range}

index = pd.MultiIndex.from_product((min_samples_range, distance_metrics, epsilons_range))

metrics_dataframe_optics = pd.DataFrame(index=index, columns=clustering_metrics_titles)
In [91]:
for min_samples, distance_metric, epsilon in itertools.product(min_samples_range, distance_metrics, epsilons_range):
    algorithm = OPTICS(min_samples=min_samples, metric=distance_metric, eps=epsilon)
    optics_predictions = algorithm.fit_predict(dataset_2d)
    
    optics_clustering_labels_mapping[epsilon][distance_metric][min_samples] = optics_predictions
    
    for metric, metric_title in zip(clustering_metrics, clustering_metrics_titles):
        if metric_title not in ('silhouette_score', 'davies_bouldin_score', 'calinski_harabasz_score'):
            metrics_dataframe_optics.loc[(min_samples, distance_metric, epsilon), metric_title] = metric(
                labels, optics_predictions)
        else:
            metrics_dataframe_optics.loc[(min_samples, distance_metric, epsilon), metric_title] = metric(dataset_2d, labels)
In [92]:
metrics_dataframe_optics.index.names = ['min_samples', 'metrics', 'epsilon']
metrics_dataframe_optics
Out[92]:
homogeneity_score silhouette_score davies_bouldin_score adjusted_rand_index calinski_harabasz_score adjusted_mutual_info v_measure_score completeness_score
min_samples metrics epsilon
2 euclidean 0.00001 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
0.00010 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
0.00100 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
0.01000 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
0.10000 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
l1 0.00001 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
0.00010 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
0.00100 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
0.01000 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
0.10000 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
l2 0.00001 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
0.00010 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
0.00100 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
0.01000 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
0.10000 0.821329 -0.134175 2.48296 0.0416378 4.65201 0.290241 0.53878 0.400874
manhattan 0.00001 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
0.00010 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
0.00100 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
0.01000 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
0.10000 0.813741 -0.134175 2.48296 0.0473898 4.65201 0.285213 0.535737 0.399316
cosine 0.00001 0.728044 -0.134175 2.48296 0.0108362 4.65201 0.115322 0.447583 0.323111
0.00010 0.728044 -0.134175 2.48296 0.0108362 4.65201 0.115322 0.447583 0.323111
0.00100 0.728044 -0.134175 2.48296 0.0108362 4.65201 0.115322 0.447583 0.323111
0.01000 0.728044 -0.134175 2.48296 0.0108362 4.65201 0.115322 0.447583 0.323111
0.10000 0.728044 -0.134175 2.48296 0.0108362 4.65201 0.115322 0.447583 0.323111
chebyshev 0.00001 0.828795 -0.134175 2.48296 0.0430314 4.65201 0.300971 0.544166 0.405058
0.00010 0.828795 -0.134175 2.48296 0.0430314 4.65201 0.300971 0.544166 0.405058
0.00100 0.828795 -0.134175 2.48296 0.0430314 4.65201 0.300971 0.544166 0.405058
0.01000 0.828795 -0.134175 2.48296 0.0430314 4.65201 0.300971 0.544166 0.405058
0.10000 0.828795 -0.134175 2.48296 0.0430314 4.65201 0.300971 0.544166 0.405058
3 euclidean 0.00001 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
0.00010 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
0.00100 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
0.01000 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
0.10000 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
l1 0.00001 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
0.00010 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
0.00100 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
0.01000 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
0.10000 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
l2 0.00001 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
0.00010 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
0.00100 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
0.01000 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
0.10000 0.684981 -0.134175 2.48296 0.0998927 4.65201 0.356843 0.537632 0.442454
manhattan 0.00001 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
0.00010 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
0.00100 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
0.01000 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
0.10000 0.714642 -0.134175 2.48296 0.157276 4.65201 0.416726 0.573505 0.478922
cosine 0.00001 0.603625 -0.134175 2.48296 0.0108407 4.65201 0.141685 0.410557 0.311064
0.00010 0.603625 -0.134175 2.48296 0.0108407 4.65201 0.141685 0.410557 0.311064
0.00100 0.603625 -0.134175 2.48296 0.0108407 4.65201 0.141685 0.410557 0.311064
0.01000 0.603625 -0.134175 2.48296 0.0108407 4.65201 0.141685 0.410557 0.311064
0.10000 0.603625 -0.134175 2.48296 0.0108407 4.65201 0.141685 0.410557 0.311064
chebyshev 0.00001 0.777668 -0.134175 2.48296 0.158493 4.65201 0.434496 0.593465 0.479814
0.00010 0.777668 -0.134175 2.48296 0.158493 4.65201 0.434496 0.593465 0.479814
0.00100 0.777668 -0.134175 2.48296 0.158493 4.65201 0.434496 0.593465 0.479814
0.01000 0.777668 -0.134175 2.48296 0.158493 4.65201 0.434496 0.593465 0.479814
0.10000 0.777668 -0.134175 2.48296 0.158493 4.65201 0.434496 0.593465 0.479814
4 euclidean 0.00001 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
0.00010 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
0.00100 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
0.01000 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
0.10000 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
l1 0.00001 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
0.00010 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
0.00100 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
0.01000 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
0.10000 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
l2 0.00001 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
0.00010 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
0.00100 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
0.01000 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
0.10000 0.818816 -0.134175 2.48296 0.503109 4.65201 0.663386 0.739858 0.674789
manhattan 0.00001 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
0.00010 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
0.00100 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
0.01000 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
0.10000 0.774198 -0.134175 2.48296 0.33099 4.65201 0.563594 0.665203 0.58311
cosine 0.00001 0.588913 -0.134175 2.48296 0.0362579 4.65201 0.204351 0.424751 0.33216
0.00010 0.588913 -0.134175 2.48296 0.0362579 4.65201 0.204351 0.424751 0.33216
0.00100 0.588913 -0.134175 2.48296 0.0362579 4.65201 0.204351 0.424751 0.33216
0.01000 0.588913 -0.134175 2.48296 0.0362579 4.65201 0.204351 0.424751 0.33216
0.10000 0.588913 -0.134175 2.48296 0.0362579 4.65201 0.204351 0.424751 0.33216
chebyshev 0.00001 0.769191 -0.134175 2.48296 0.302378 4.65201 0.537504 0.647212 0.558625
0.00010 0.769191 -0.134175 2.48296 0.302378 4.65201 0.537504 0.647212 0.558625
0.00100 0.769191 -0.134175 2.48296 0.302378 4.65201 0.537504 0.647212 0.558625
0.01000 0.769191 -0.134175 2.48296 0.302378 4.65201 0.537504 0.647212 0.558625
0.10000 0.769191 -0.134175 2.48296 0.302378 4.65201 0.537504 0.647212 0.558625
5 euclidean 0.00001 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
0.00010 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
0.00100 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
0.01000 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
0.10000 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
l1 0.00001 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
0.00010 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
0.00100 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
0.01000 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
0.10000 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
l2 0.00001 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
0.00010 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
0.00100 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
0.01000 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
0.10000 0.979236 -0.134175 2.48296 0.981759 4.65201 0.980173 0.983935 0.988679
manhattan 0.00001 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
0.00010 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
0.00100 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
0.01000 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
0.10000 0.807346 -0.134175 2.48296 0.653538 4.65201 0.736026 0.786364 0.766446
cosine 0.00001 0.535761 -0.134175 2.48296 0.0383039 4.65201 0.20241 0.405964 0.326793
0.00010 0.535761 -0.134175 2.48296 0.0383039 4.65201 0.20241 0.405964 0.326793
0.00100 0.535761 -0.134175 2.48296 0.0383039 4.65201 0.20241 0.405964 0.326793
0.01000 0.535761 -0.134175 2.48296 0.0383039 4.65201 0.20241 0.405964 0.326793
0.10000 0.535761 -0.134175 2.48296 0.0383039 4.65201 0.20241 0.405964 0.326793
chebyshev 0.00001 0.682515 -0.134175 2.48296 0.523449 4.65201 0.633742 0.701212 0.720962
0.00010 0.682515 -0.134175 2.48296 0.523449 4.65201 0.633742 0.701212 0.720962
0.00100 0.682515 -0.134175 2.48296 0.523449 4.65201 0.633742 0.701212 0.720962
0.01000 0.682515 -0.134175 2.48296 0.523449 4.65201 0.633742 0.701212 0.720962
0.10000 0.682515 -0.134175 2.48296 0.523449 4.65201 0.633742 0.701212 0.720962
6 euclidean 0.00001 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
0.00010 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
0.00100 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
0.01000 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
0.10000 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
l1 0.00001 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
0.00010 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
0.00100 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
0.01000 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
0.10000 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
l2 0.00001 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
0.00010 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
0.00100 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
0.01000 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
0.10000 0.450183 -0.134175 2.48296 0.407047 4.65201 0.528333 0.585697 0.837931
manhattan 0.00001 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
0.00010 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
0.00100 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
0.01000 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
0.10000 0.635329 -0.134175 2.48296 0.504616 4.65201 0.604343 0.670645 0.710118
cosine 0.00001 0.492118 -0.134175 2.48296 0.0396713 4.65201 0.211922 0.394421 0.329089
0.00010 0.492118 -0.134175 2.48296 0.0396713 4.65201 0.211922 0.394421 0.329089
0.00100 0.492118 -0.134175 2.48296 0.0396713 4.65201 0.211922 0.394421 0.329089
0.01000 0.492118 -0.134175 2.48296 0.0396713 4.65201 0.211922 0.394421 0.329089
0.10000 0.492118 -0.134175 2.48296 0.0396713 4.65201 0.211922 0.394421 0.329089
chebyshev 0.00001 0.583096 -0.134175 2.48296 0.499139 4.65201 0.62432 0.679875 0.815172
0.00010 0.583096 -0.134175 2.48296 0.499139 4.65201 0.62432 0.679875 0.815172
0.00100 0.583096 -0.134175 2.48296 0.499139 4.65201 0.62432 0.679875 0.815172
0.01000 0.583096 -0.134175 2.48296 0.499139 4.65201 0.62432 0.679875 0.815172
0.10000 0.583096 -0.134175 2.48296 0.499139 4.65201 0.62432 0.679875 0.815172
7 euclidean 0.00001 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
0.00010 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
0.00100 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
0.01000 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
0.10000 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
l1 0.00001 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
0.00010 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
0.00100 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
0.01000 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
0.10000 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
l2 0.00001 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
0.00010 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
0.00100 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
0.01000 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
0.10000 0.572547 -0.134175 2.48296 0.530855 4.65201 0.613816 0.668549 0.80323
manhattan 0.00001 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
0.00010 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
0.00100 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
0.01000 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
0.10000 0.534079 -0.134175 2.48296 0.492559 4.65201 0.563712 0.625454 0.754549
cosine 0.00001 0.411782 -0.134175 2.48296 0.052753 4.65201 0.199701 0.362546 0.323826
0.00010 0.411782 -0.134175 2.48296 0.052753 4.65201 0.199701 0.362546 0.323826
0.00100 0.411782 -0.134175 2.48296 0.052753 4.65201 0.199701 0.362546 0.323826
0.01000 0.411782 -0.134175 2.48296 0.052753 4.65201 0.199701 0.362546 0.323826
0.10000 0.411782 -0.134175 2.48296 0.052753 4.65201 0.199701 0.362546 0.323826
chebyshev 0.00001 0.512014 -0.134175 2.48296 0.488306 4.65201 0.589737 0.640358 0.85457
0.00010 0.512014 -0.134175 2.48296 0.488306 4.65201 0.589737 0.640358 0.85457
0.00100 0.512014 -0.134175 2.48296 0.488306 4.65201 0.589737 0.640358 0.85457
0.01000 0.512014 -0.134175 2.48296 0.488306 4.65201 0.589737 0.640358 0.85457
0.10000 0.512014 -0.134175 2.48296 0.488306 4.65201 0.589737 0.640358 0.85457
8 euclidean 0.00001 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
0.00010 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
0.00100 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
0.01000 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
0.10000 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
l1 0.00001 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
0.00010 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
0.00100 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
0.01000 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
0.10000 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
l2 0.00001 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
0.00010 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
0.00100 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
0.01000 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
0.10000 0.346491 -0.134175 2.48296 0.331913 4.65201 0.415377 0.475241 0.75625
manhattan 0.00001 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
0.00010 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
0.00100 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
0.01000 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
0.10000 0.297298 -0.134175 2.48296 0.263043 4.65201 0.356733 0.416773 0.69679
cosine 0.00001 0.365248 -0.134175 2.48296 -0.00270884 4.65201 0.174231 0.32976 0.300557
0.00010 0.365248 -0.134175 2.48296 -0.00270884 4.65201 0.174231 0.32976 0.300557
0.00100 0.365248 -0.134175 2.48296 -0.00270884 4.65201 0.174231 0.32976 0.300557
0.01000 0.365248 -0.134175 2.48296 -0.00270884 4.65201 0.174231 0.32976 0.300557
0.10000 0.365248 -0.134175 2.48296 -0.00270884 4.65201 0.174231 0.32976 0.300557
chebyshev 0.00001 0.42816 -0.134175 2.48296 0.414836 4.65201 0.49914 0.552453 0.778426
0.00010 0.42816 -0.134175 2.48296 0.414836 4.65201 0.49914 0.552453 0.778426
0.00100 0.42816 -0.134175 2.48296 0.414836 4.65201 0.49914 0.552453 0.778426
0.01000 0.42816 -0.134175 2.48296 0.414836 4.65201 0.49914 0.552453 0.778426
0.10000 0.42816 -0.134175 2.48296 0.414836 4.65201 0.49914 0.552453 0.778426
9 euclidean 0.00001 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
0.00010 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
0.00100 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
0.01000 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
0.10000 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
l1 0.00001 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
0.00010 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
0.00100 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
0.01000 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
0.10000 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
l2 0.00001 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
0.00010 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
0.00100 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
0.01000 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
0.10000 0.395001 -0.134175 2.48296 0.355726 4.65201 0.474071 0.524739 0.781385
manhattan 0.00001 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
0.00010 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
0.00100 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
0.01000 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
0.10000 0.336806 -0.134175 2.48296 0.267637 4.65201 0.377302 0.437691 0.624857
cosine 0.00001 0.322613 -0.134175 2.48296 -0.0293647 4.65201 0.165117 0.307012 0.292851
0.00010 0.322613 -0.134175 2.48296 -0.0293647 4.65201 0.165117 0.307012 0.292851
0.00100 0.322613 -0.134175 2.48296 -0.0293647 4.65201 0.165117 0.307012 0.292851
0.01000 0.322613 -0.134175 2.48296 -0.0293647 4.65201 0.165117 0.307012 0.292851
0.10000 0.322613 -0.134175 2.48296 -0.0293647 4.65201 0.165117 0.307012 0.292851
chebyshev 0.00001 0.332327 -0.134175 2.48296 0.288 4.65201 0.408908 0.45834 0.738289
0.00010 0.332327 -0.134175 2.48296 0.288 4.65201 0.408908 0.45834 0.738289
0.00100 0.332327 -0.134175 2.48296 0.288 4.65201 0.408908 0.45834 0.738289
0.01000 0.332327 -0.134175 2.48296 0.288 4.65201 0.408908 0.45834 0.738289
0.10000 0.332327 -0.134175 2.48296 0.288 4.65201 0.408908 0.45834 0.738289

Find best parameters for OPTICS Clustering

Davies_bouldin_score we have to minimize

In [93]:
metrics_dataframe_optics[metrics_min].style.apply(highlight_min)
Out[93]:
davies_bouldin_score
min_samples metrics epsilon
2 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
3 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
4 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
5 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
6 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
7 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
8 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
9 euclidean 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l1 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
l2 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
manhattan 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
cosine 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960
chebyshev 1e-05 2.482960
0.0001 2.482960
0.001 2.482960
0.01 2.482960
0.1 2.482960

Other metrics we have to maximize

In [94]:
metrics_dataframe_optics[metrics_max].style.apply(highlight_max)
Out[94]:
homogeneity_score v_measure_score completeness_score adjusted_mutual_info adjusted_rand_index calinski_harabasz_score silhouette_score
min_samples metrics epsilon
2 euclidean 1e-05 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
0.0001 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
0.001 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
0.01 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
0.1 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
l1 1e-05 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
0.0001 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
0.001 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
0.01 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
0.1 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
l2 1e-05 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
0.0001 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
0.001 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
0.01 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
0.1 0.821329 0.538780 0.400874 0.290241 0.041638 4.652007 -0.134175
manhattan 1e-05 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
0.0001 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
0.001 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
0.01 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
0.1 0.813741 0.535737 0.399316 0.285213 0.047390 4.652007 -0.134175
cosine 1e-05 0.728044 0.447583 0.323111 0.115322 0.010836 4.652007 -0.134175
0.0001 0.728044 0.447583 0.323111 0.115322 0.010836 4.652007 -0.134175
0.001 0.728044 0.447583 0.323111 0.115322 0.010836 4.652007 -0.134175
0.01 0.728044 0.447583 0.323111 0.115322 0.010836 4.652007 -0.134175
0.1 0.728044 0.447583 0.323111 0.115322 0.010836 4.652007 -0.134175
chebyshev 1e-05 0.828795 0.544166 0.405058 0.300971 0.043031 4.652007 -0.134175
0.0001 0.828795 0.544166 0.405058 0.300971 0.043031 4.652007 -0.134175
0.001 0.828795 0.544166 0.405058 0.300971 0.043031 4.652007 -0.134175
0.01 0.828795 0.544166 0.405058 0.300971 0.043031 4.652007 -0.134175
0.1 0.828795 0.544166 0.405058 0.300971 0.043031 4.652007 -0.134175
3 euclidean 1e-05 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
0.0001 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
0.001 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
0.01 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
0.1 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
l1 1e-05 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
0.0001 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
0.001 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
0.01 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
0.1 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
l2 1e-05 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
0.0001 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
0.001 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
0.01 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
0.1 0.684981 0.537632 0.442454 0.356843 0.099893 4.652007 -0.134175
manhattan 1e-05 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
0.0001 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
0.001 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
0.01 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
0.1 0.714642 0.573505 0.478922 0.416726 0.157276 4.652007 -0.134175
cosine 1e-05 0.603625 0.410557 0.311064 0.141685 0.010841 4.652007 -0.134175
0.0001 0.603625 0.410557 0.311064 0.141685 0.010841 4.652007 -0.134175
0.001 0.603625 0.410557 0.311064 0.141685 0.010841 4.652007 -0.134175
0.01 0.603625 0.410557 0.311064 0.141685 0.010841 4.652007 -0.134175
0.1 0.603625 0.410557 0.311064 0.141685 0.010841 4.652007 -0.134175
chebyshev 1e-05 0.777668 0.593465 0.479814 0.434496 0.158493 4.652007 -0.134175
0.0001 0.777668 0.593465 0.479814 0.434496 0.158493 4.652007 -0.134175
0.001 0.777668 0.593465 0.479814 0.434496 0.158493 4.652007 -0.134175
0.01 0.777668 0.593465 0.479814 0.434496 0.158493 4.652007 -0.134175
0.1 0.777668 0.593465 0.479814 0.434496 0.158493 4.652007 -0.134175
4 euclidean 1e-05 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
0.0001 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
0.001 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
0.01 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
0.1 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
l1 1e-05 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
0.0001 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
0.001 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
0.01 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
0.1 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
l2 1e-05 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
0.0001 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
0.001 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
0.01 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
0.1 0.818816 0.739858 0.674789 0.663386 0.503109 4.652007 -0.134175
manhattan 1e-05 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
0.0001 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
0.001 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
0.01 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
0.1 0.774198 0.665203 0.583110 0.563594 0.330990 4.652007 -0.134175
cosine 1e-05 0.588913 0.424751 0.332160 0.204351 0.036258 4.652007 -0.134175
0.0001 0.588913 0.424751 0.332160 0.204351 0.036258 4.652007 -0.134175
0.001 0.588913 0.424751 0.332160 0.204351 0.036258 4.652007 -0.134175
0.01 0.588913 0.424751 0.332160 0.204351 0.036258 4.652007 -0.134175
0.1 0.588913 0.424751 0.332160 0.204351 0.036258 4.652007 -0.134175
chebyshev 1e-05 0.769191 0.647212 0.558625 0.537504 0.302378 4.652007 -0.134175
0.0001 0.769191 0.647212 0.558625 0.537504 0.302378 4.652007 -0.134175
0.001 0.769191 0.647212 0.558625 0.537504 0.302378 4.652007 -0.134175
0.01 0.769191 0.647212 0.558625 0.537504 0.302378 4.652007 -0.134175
0.1 0.769191 0.647212 0.558625 0.537504 0.302378 4.652007 -0.134175
5 euclidean 1e-05 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
0.0001 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
0.001 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
0.01 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
0.1 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
l1 1e-05 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
0.0001 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
0.001 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
0.01 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
0.1 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
l2 1e-05 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
0.0001 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
0.001 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
0.01 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
0.1 0.979236 0.983935 0.988679 0.980173 0.981759 4.652007 -0.134175
manhattan 1e-05 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
0.0001 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
0.001 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
0.01 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
0.1 0.807346 0.786364 0.766446 0.736026 0.653538 4.652007 -0.134175
cosine 1e-05 0.535761 0.405964 0.326793 0.202410 0.038304 4.652007 -0.134175
0.0001 0.535761 0.405964 0.326793 0.202410 0.038304 4.652007 -0.134175
0.001 0.535761 0.405964 0.326793 0.202410 0.038304 4.652007 -0.134175
0.01 0.535761 0.405964 0.326793 0.202410 0.038304 4.652007 -0.134175
0.1 0.535761 0.405964 0.326793 0.202410 0.038304 4.652007 -0.134175
chebyshev 1e-05 0.682515 0.701212 0.720962 0.633742 0.523449 4.652007 -0.134175
0.0001 0.682515 0.701212 0.720962 0.633742 0.523449 4.652007 -0.134175
0.001 0.682515 0.701212 0.720962 0.633742 0.523449 4.652007 -0.134175
0.01 0.682515 0.701212 0.720962 0.633742 0.523449 4.652007 -0.134175
0.1 0.682515 0.701212 0.720962 0.633742 0.523449 4.652007 -0.134175
6 euclidean 1e-05 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
0.0001 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
0.001 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
0.01 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
0.1 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
l1 1e-05 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
0.0001 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
0.001 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
0.01 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
0.1 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
l2 1e-05 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
0.0001 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
0.001 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
0.01 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
0.1 0.450183 0.585697 0.837931 0.528333 0.407047 4.652007 -0.134175
manhattan 1e-05 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
0.0001 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
0.001 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
0.01 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
0.1 0.635329 0.670645 0.710118 0.604343 0.504616 4.652007 -0.134175
cosine 1e-05 0.492118 0.394421 0.329089 0.211922 0.039671 4.652007 -0.134175
0.0001 0.492118 0.394421 0.329089 0.211922 0.039671 4.652007 -0.134175
0.001 0.492118 0.394421 0.329089 0.211922 0.039671 4.652007 -0.134175
0.01 0.492118 0.394421 0.329089 0.211922 0.039671 4.652007 -0.134175
0.1 0.492118 0.394421 0.329089 0.211922 0.039671 4.652007 -0.134175
chebyshev 1e-05 0.583096 0.679875 0.815172 0.624320 0.499139 4.652007 -0.134175
0.0001 0.583096 0.679875 0.815172 0.624320 0.499139 4.652007 -0.134175
0.001 0.583096 0.679875 0.815172 0.624320 0.499139 4.652007 -0.134175
0.01 0.583096 0.679875 0.815172 0.624320 0.499139 4.652007 -0.134175
0.1 0.583096 0.679875 0.815172 0.624320 0.499139 4.652007 -0.134175
7 euclidean 1e-05 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
0.0001 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
0.001 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
0.01 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
0.1 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
l1 1e-05 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
0.0001 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
0.001 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
0.01 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
0.1 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
l2 1e-05 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
0.0001 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
0.001 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
0.01 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
0.1 0.572547 0.668549 0.803230 0.613816 0.530855 4.652007 -0.134175
manhattan 1e-05 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
0.0001 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
0.001 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
0.01 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
0.1 0.534079 0.625454 0.754549 0.563712 0.492559 4.652007 -0.134175
cosine 1e-05 0.411782 0.362546 0.323826 0.199701 0.052753 4.652007 -0.134175
0.0001 0.411782 0.362546 0.323826 0.199701 0.052753 4.652007 -0.134175
0.001 0.411782 0.362546 0.323826 0.199701 0.052753 4.652007 -0.134175
0.01 0.411782 0.362546 0.323826 0.199701 0.052753 4.652007 -0.134175
0.1 0.411782 0.362546 0.323826 0.199701 0.052753 4.652007 -0.134175
chebyshev 1e-05 0.512014 0.640358 0.854570 0.589737 0.488306 4.652007 -0.134175
0.0001 0.512014 0.640358 0.854570 0.589737 0.488306 4.652007 -0.134175
0.001 0.512014 0.640358 0.854570 0.589737 0.488306 4.652007 -0.134175
0.01 0.512014 0.640358 0.854570 0.589737 0.488306 4.652007 -0.134175
0.1 0.512014 0.640358 0.854570 0.589737 0.488306 4.652007 -0.134175
8 euclidean 1e-05 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
0.0001 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
0.001 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
0.01 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
0.1 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
l1 1e-05 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
0.0001 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
0.001 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
0.01 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
0.1 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
l2 1e-05 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
0.0001 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
0.001 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
0.01 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
0.1 0.346491 0.475241 0.756250 0.415377 0.331913 4.652007 -0.134175
manhattan 1e-05 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
0.0001 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
0.001 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
0.01 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
0.1 0.297298 0.416773 0.696790 0.356733 0.263043 4.652007 -0.134175
cosine 1e-05 0.365248 0.329760 0.300557 0.174231 -0.002709 4.652007 -0.134175
0.0001 0.365248 0.329760 0.300557 0.174231 -0.002709 4.652007 -0.134175
0.001 0.365248 0.329760 0.300557 0.174231 -0.002709 4.652007 -0.134175
0.01 0.365248 0.329760 0.300557 0.174231 -0.002709 4.652007 -0.134175
0.1 0.365248 0.329760 0.300557 0.174231 -0.002709 4.652007 -0.134175
chebyshev 1e-05 0.428160 0.552453 0.778426 0.499140 0.414836 4.652007 -0.134175
0.0001 0.428160 0.552453 0.778426 0.499140 0.414836 4.652007 -0.134175
0.001 0.428160 0.552453 0.778426 0.499140 0.414836 4.652007 -0.134175
0.01 0.428160 0.552453 0.778426 0.499140 0.414836 4.652007 -0.134175
0.1 0.428160 0.552453 0.778426 0.499140 0.414836 4.652007 -0.134175
9 euclidean 1e-05 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
0.0001 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
0.001 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
0.01 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
0.1 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
l1 1e-05 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
0.0001 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
0.001 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
0.01 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
0.1 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
l2 1e-05 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
0.0001 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
0.001 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
0.01 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
0.1 0.395001 0.524739 0.781385 0.474071 0.355726 4.652007 -0.134175
manhattan 1e-05 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
0.0001 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
0.001 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
0.01 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
0.1 0.336806 0.437691 0.624857 0.377302 0.267637 4.652007 -0.134175
cosine 1e-05 0.322613 0.307012 0.292851 0.165117 -0.029365 4.652007 -0.134175
0.0001 0.322613 0.307012 0.292851 0.165117 -0.029365 4.652007 -0.134175
0.001 0.322613 0.307012 0.292851 0.165117 -0.029365 4.652007 -0.134175
0.01 0.322613 0.307012 0.292851 0.165117 -0.029365 4.652007 -0.134175
0.1 0.322613 0.307012 0.292851 0.165117 -0.029365 4.652007 -0.134175
chebyshev 1e-05 0.332327 0.458340 0.738289 0.408908 0.288000 4.652007 -0.134175
0.0001 0.332327 0.458340 0.738289 0.408908 0.288000 4.652007 -0.134175
0.001 0.332327 0.458340 0.738289 0.408908 0.288000 4.652007 -0.134175
0.01 0.332327 0.458340 0.738289 0.408908 0.288000 4.652007 -0.134175
0.1 0.332327 0.458340 0.738289 0.408908 0.288000 4.652007 -0.134175

Seems like 4 clusters and Euclidean or L2 are the best for OPTICS algorithm. Epsilon doesn't influence on change metrics values.

Agglomerative Clustering

Experiments with number of clusters and distance metrics

In [95]:
clusters_range = range(2, 10)
distance_metrics = ('euclidean', 'l1', 'l2', 'manhattan', 'cosine')
In [96]:
agglomerative_clustering_labels_mapping = defaultdict(dict)

index = pd.MultiIndex.from_product((clusters_range, distance_metrics))

metrics_dataframe_agglomerative = pd.DataFrame(index=index, columns=clustering_metrics_titles)
In [97]:
for nclusters, distance_metric in itertools.product(clusters_range, distance_metrics):
    algorithm = AgglomerativeClustering(n_clusters=nclusters, affinity=distance_metric, linkage='average')
    agglomerative_predictions = algorithm.fit_predict(dataset_2d)
    
    agglomerative_clustering_labels_mapping[nclusters][distance_metric] = agglomerative_predictions
    
    for metric, metric_title in zip(clustering_metrics, clustering_metrics_titles):
        if metric_title not in ('silhouette_score', 'davies_bouldin_score', 'calinski_harabasz_score'):
            metrics_dataframe_agglomerative.loc[(nclusters, distance_metric), metric_title] = metric(
                labels, agglomerative_predictions)
        else:
            metrics_dataframe_agglomerative.loc[(nclusters, distance_metric), metric_title] = metric(dataset_2d, labels)
In [98]:
metrics_dataframe_agglomerative.index.names = ['nclusters', 'affinity']
metrics_dataframe_agglomerative
Out[98]:
homogeneity_score silhouette_score davies_bouldin_score adjusted_rand_index calinski_harabasz_score adjusted_mutual_info v_measure_score completeness_score
nclusters affinity
2 euclidean 0.00522406 -0.134175 2.48296 -0.0224533 4.65201 -0.00689742 0.0100151 0.12082
l1 0.00522406 -0.134175 2.48296 -0.0224533 4.65201 -0.00689742 0.0100151 0.12082
l2 0.00522406 -0.134175 2.48296 -0.0224533 4.65201 -0.00689742 0.0100151 0.12082
manhattan 0.00522406 -0.134175 2.48296 -0.0224533 4.65201 -0.00689742 0.0100151 0.12082
cosine 0.151762 -0.134175 2.48296 0.0259726 4.65201 0.20474 0.224735 0.432877
3 euclidean 0.00522406 -0.134175 2.48296 -0.0226399 4.65201 -0.0116177 0.00997433 0.109978
l1 0.00522406 -0.134175 2.48296 -0.0226399 4.65201 -0.0116177 0.00997433 0.109978
l2 0.00522406 -0.134175 2.48296 -0.0226399 4.65201 -0.0116177 0.00997433 0.109978
manhattan 0.00522406 -0.134175 2.48296 -0.0226399 4.65201 -0.0116177 0.00997433 0.109978
cosine 0.215039 -0.134175 2.48296 0.0136465 4.65201 0.24806 0.283669 0.416637
4 euclidean 0.00734847 -0.134175 2.48296 -0.0316725 4.65201 -0.0174656 0.0137627 0.108261
l1 0.00628373 -0.134175 2.48296 -0.0271862 4.65201 -0.016154 0.0118687 0.106734
l2 0.00734847 -0.134175 2.48296 -0.0316725 4.65201 -0.0174656 0.0137627 0.108261
manhattan 0.00628373 -0.134175 2.48296 -0.0271862 4.65201 -0.016154 0.0118687 0.106734
cosine 0.266471 -0.134175 2.48296 0.0398791 4.65201 0.286235 0.331667 0.439099
5 euclidean 0.144991 -0.134175 2.48296 -0.0417267 4.65201 0.168924 0.209538 0.377667
l1 0.141932 -0.134175 2.48296 -0.0372349 4.65201 0.168137 0.207083 0.382795
l2 0.144991 -0.134175 2.48296 -0.0417267 4.65201 0.168924 0.209538 0.377667
manhattan 0.141932 -0.134175 2.48296 -0.0372349 4.65201 0.168137 0.207083 0.382795
cosine 0.298072 -0.134175 2.48296 0.0475949 4.65201 0.303655 0.358513 0.449699
6 euclidean 0.147517 -0.134175 2.48296 -0.0476522 4.65201 0.163778 0.21031 0.366181
l1 0.177461 -0.134175 2.48296 -0.0417121 4.65201 0.19133 0.242907 0.384828
l2 0.147517 -0.134175 2.48296 -0.0476522 4.65201 0.163778 0.21031 0.366181
manhattan 0.177461 -0.134175 2.48296 -0.0417121 4.65201 0.19133 0.242907 0.384828
cosine 0.324893 -0.134175 2.48296 0.0268833 4.65201 0.305716 0.371163 0.432801
7 euclidean 0.184109 -0.134175 2.48296 -0.0511091 4.65201 0.187568 0.246072 0.370902
l1 0.179842 -0.134175 2.48296 -0.0426574 4.65201 0.186603 0.24403 0.379467
l2 0.184109 -0.134175 2.48296 -0.0511091 4.65201 0.187568 0.246072 0.370902
manhattan 0.179842 -0.134175 2.48296 -0.0426574 4.65201 0.186603 0.24403 0.379467
cosine 0.395755 -0.134175 2.48296 0.0659152 4.65201 0.344984 0.414691 0.43553
8 euclidean 0.195728 -0.134175 2.48296 -0.0834283 4.65201 0.178491 0.250154 0.346509
l1 0.217021 -0.134175 2.48296 -0.0579685 4.65201 0.205784 0.276201 0.37976
l2 0.195728 -0.134175 2.48296 -0.0834283 4.65201 0.178491 0.250154 0.346509
manhattan 0.217021 -0.134175 2.48296 -0.0579685 4.65201 0.205784 0.276201 0.37976
cosine 0.400672 -0.134175 2.48296 0.0655838 4.65201 0.33461 0.411821 0.423609
9 euclidean 0.233819 -0.134175 2.48296 -0.0935676 4.65201 0.198479 0.281717 0.354294
l1 0.229581 -0.134175 2.48296 -0.0750494 4.65201 0.199326 0.281768 0.36466
l2 0.233819 -0.134175 2.48296 -0.0935676 4.65201 0.198479 0.281717 0.354294
manhattan 0.229581 -0.134175 2.48296 -0.0750494 4.65201 0.199326 0.281768 0.36466
cosine 0.407549 -0.134175 2.48296 0.0645973 4.65201 0.329608 0.412996 0.41859

Find best nclusters and affinity for Agglomerative Clustering

Davies_bouldin_score we have to minimize

In [99]:
metrics_dataframe_agglomerative[metrics_min].style.apply(highlight_min)
Out[99]:
davies_bouldin_score
nclusters affinity
2 euclidean 2.482960
l1 2.482960
l2 2.482960
manhattan 2.482960
cosine 2.482960
3 euclidean 2.482960
l1 2.482960
l2 2.482960
manhattan 2.482960
cosine 2.482960
4 euclidean 2.482960
l1 2.482960
l2 2.482960
manhattan 2.482960
cosine 2.482960
5 euclidean 2.482960
l1 2.482960
l2 2.482960
manhattan 2.482960
cosine 2.482960
6 euclidean 2.482960
l1 2.482960
l2 2.482960
manhattan 2.482960
cosine 2.482960
7 euclidean 2.482960
l1 2.482960
l2 2.482960
manhattan 2.482960
cosine 2.482960
8 euclidean 2.482960
l1 2.482960
l2 2.482960
manhattan 2.482960
cosine 2.482960
9 euclidean 2.482960
l1 2.482960
l2 2.482960
manhattan 2.482960
cosine 2.482960

Other metrics we have to maximize

In [100]:
metrics_dataframe_agglomerative[metrics_max].style.apply(highlight_max)
Out[100]:
homogeneity_score v_measure_score completeness_score adjusted_mutual_info adjusted_rand_index calinski_harabasz_score silhouette_score
nclusters affinity
2 euclidean 0.005224 0.010015 0.120820 -0.006897 -0.022453 4.652007 -0.134175
l1 0.005224 0.010015 0.120820 -0.006897 -0.022453 4.652007 -0.134175
l2 0.005224 0.010015 0.120820 -0.006897 -0.022453 4.652007 -0.134175
manhattan 0.005224 0.010015 0.120820 -0.006897 -0.022453 4.652007 -0.134175
cosine 0.151762 0.224735 0.432877 0.204740 0.025973 4.652007 -0.134175
3 euclidean 0.005224 0.009974 0.109978 -0.011618 -0.022640 4.652007 -0.134175
l1 0.005224 0.009974 0.109978 -0.011618 -0.022640 4.652007 -0.134175
l2 0.005224 0.009974 0.109978 -0.011618 -0.022640 4.652007 -0.134175
manhattan 0.005224 0.009974 0.109978 -0.011618 -0.022640 4.652007 -0.134175
cosine 0.215039 0.283669 0.416637 0.248060 0.013647 4.652007 -0.134175
4 euclidean 0.007348 0.013763 0.108261 -0.017466 -0.031672 4.652007 -0.134175
l1 0.006284 0.011869 0.106734 -0.016154 -0.027186 4.652007 -0.134175
l2 0.007348 0.013763 0.108261 -0.017466 -0.031672 4.652007 -0.134175
manhattan 0.006284 0.011869 0.106734 -0.016154 -0.027186 4.652007 -0.134175
cosine 0.266471 0.331667 0.439099 0.286235 0.039879 4.652007 -0.134175
5 euclidean 0.144991 0.209538 0.377667 0.168924 -0.041727 4.652007 -0.134175
l1 0.141932 0.207083 0.382795 0.168137 -0.037235 4.652007 -0.134175
l2 0.144991 0.209538 0.377667 0.168924 -0.041727 4.652007 -0.134175
manhattan 0.141932 0.207083 0.382795 0.168137 -0.037235 4.652007 -0.134175
cosine 0.298072 0.358513 0.449699 0.303655 0.047595 4.652007 -0.134175
6 euclidean 0.147517 0.210310 0.366181 0.163778 -0.047652 4.652007 -0.134175
l1 0.177461 0.242907 0.384828 0.191330 -0.041712 4.652007 -0.134175
l2 0.147517 0.210310 0.366181 0.163778 -0.047652 4.652007 -0.134175
manhattan 0.177461 0.242907 0.384828 0.191330 -0.041712 4.652007 -0.134175
cosine 0.324893 0.371163 0.432801 0.305716 0.026883 4.652007 -0.134175
7 euclidean 0.184109 0.246072 0.370902 0.187568 -0.051109 4.652007 -0.134175
l1 0.179842 0.244030 0.379467 0.186603 -0.042657 4.652007 -0.134175
l2 0.184109 0.246072 0.370902 0.187568 -0.051109 4.652007 -0.134175
manhattan 0.179842 0.244030 0.379467 0.186603 -0.042657 4.652007 -0.134175
cosine 0.395755 0.414691 0.435530 0.344984 0.065915 4.652007 -0.134175
8 euclidean 0.195728 0.250154 0.346509 0.178491 -0.083428 4.652007 -0.134175
l1 0.217021 0.276201 0.379760 0.205784 -0.057969 4.652007 -0.134175
l2 0.195728 0.250154 0.346509 0.178491 -0.083428 4.652007 -0.134175
manhattan 0.217021 0.276201 0.379760 0.205784 -0.057969 4.652007 -0.134175
cosine 0.400672 0.411821 0.423609 0.334610 0.065584 4.652007 -0.134175
9 euclidean 0.233819 0.281717 0.354294 0.198479 -0.093568 4.652007 -0.134175
l1 0.229581 0.281768 0.364660 0.199326 -0.075049 4.652007 -0.134175
l2 0.233819 0.281717 0.354294 0.198479 -0.093568 4.652007 -0.134175
manhattan 0.229581 0.281768 0.364660 0.199326 -0.075049 4.652007 -0.134175
cosine 0.407549 0.412996 0.418590 0.329608 0.064597 4.652007 -0.134175

Seems like 7 clusters and cosine are the best for Agglomerative Clustering algorithm

Vizualize clusters for each parameter

In [101]:
fig, axs = plt.subplots(nrows=len(clusters_range), ncols=len(distance_metrics), figsize=(100, 120))

idx = 0

for i, data_agg in enumerate(agglomerative_clustering_labels_mapping.items()):
    nclusters, data_dict = data_agg
    for j, data_agg1 in enumerate(data_dict.items()):
        affinity, labels = data_agg1
        colors_mapping = [(item/255.) for item in labels]
        axs[i][j].scatter(dataset_2d[:, 0], dataset_2d[:, 1], c=colors_mapping);
        axs[i][j].set_title('Agglomerative Clustering, number of selected clusters: {}, affinity: {}'.format(
            nclusters, affinity))
In [ ]:
 
In [ ]: